/* Site-specific additions layered on top of style.css */

/* Ensure all interactive elements are touch-friendly */
button,
[role="button"],
.prod-card,
.news-card,
.team-member,
.pub-trigger,
.prod-trigger,
.news-trigger {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Touch-device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Mobile/Touch devices - improve touch targets */
    button,
    a,
    [role="button"],
    .prod-card,
    .news-card,
    .team-member {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }
    
    /* Disable hover effects on touch devices */
    button:hover,
    a:hover,
    .prod-card:hover,
    .news-card:hover {
        background-color: transparent;
        transform: none;
    }
    
    /* Add active/pressed state for touch */
    button:active,
    a:active,
    [role="button"]:active,
    .prod-card:active,
    .news-card:active {
        opacity: 0.8;
    }
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 10px 16px;
    background: #fff;
    color: #000;
}

.skip-link:focus {
    left: 0;
}

.header-logo {
    max-width: 320px;
    width: 60%;
    height: auto;
}

/* The brand image is taller than the 50px navbar and was being clipped. */
.navbar-brand {
    height: auto;
    padding: 8px 15px;
}

.navbar-brand > img {
    max-height: 34px;
    width: auto;
}

.about-points {
    text-align: left;
    margin-top: 25px;
}

.about-points dt {
    font-weight: 700;
    margin-top: 12px;
}

.about-points dd {
    margin: 0 0 8px 0;
}

/* Publication cards are buttons so they are keyboard reachable. */
button.team-member {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
    width: 100%;
    border: 0;
    background: none;
    padding: 0;
    text-align: center;
    cursor: pointer;
}

button.team-member:focus-visible,
.pub-modal-close:focus-visible {
    outline: 3px solid #ff9800;
    outline-offset: 2px;
}

/* Flex row so uneven card heights can't snag on each other like floated columns do. */
.pub-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.pub-col {
    float: none;
    display: flex;
    margin-bottom: 25px;
}

/* Mobile first: caption sits below the image instead of floating over it. */
.team-member,
.team-member > img {
    float: none;
}

.team-member {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    overflow: hidden;
}

.team-member > img {
    display: block;
    width: 100%;
    height: auto;
}

.team-member > h3 {
    position: static;
    flex: 1 1 auto;
    bottom: auto;
    width: 100%;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: 0;
    padding: 15px;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.team-member > h3 strong {
    display: block;
}

.pub-excerpt {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 400;
}

/* Neutralise the desktop hover effect; on touch it sticks after a tap. */
.team-member:hover > h3 {
    background: rgba(95, 154, 255, 0.85);
    bottom: auto;
}

/* Only devices with a real pointer get the overlay + slide-up effect. */
@media (min-width: 992px) and (hover: hover) {
    .team-member > h3 {
        position: absolute;
        bottom: 25px;
        padding: 15px 12px;
    }

    .team-member:hover > h3 {
        background: #000;
        bottom: -55px;
    }
}

/* Publication modal - prefixed so it never collides with Bootstrap's .modal */
.pub-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pub-modal[hidden] {
    display: none;
}

.pub-modal-content {
    position: relative;
    background-color: #fefefe;
    color: #222;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pub-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-right: 40px;
    padding-bottom: 15px;
    color: #222;
    font-size: 24px;
    font-weight: 700;
    border-bottom: 3px solid #AA570A;
}

.pub-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: none;
    color: #999;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.pub-modal-close:hover,
.pub-modal-close:focus {
    color: #AA570A;
    background-color: #f5f5f5;
    transform: rotate(90deg);
}

body.pub-modal-open {
    overflow: hidden;
}

/* HTML content styling in modals */
.pub-modal-body,
.prod-modal-text,
.news-modal-text {
    line-height: 1.8;
    color: #444;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.prod-modal-text {
    text-align: left;
}

.pub-modal-body p,
.prod-modal-text p,
.news-modal-text p {
    margin: 16px 0;
    line-height: 1.7;
}

.pub-modal-body ul,
.pub-modal-body ol,
.prod-modal-text ul,
.prod-modal-text ol,
.news-modal-text ul,
.news-modal-text ol {
    margin: 16px 0;
    padding-left: 40px;
}

.pub-modal-body ul,
.prod-modal-text ul,
.news-modal-text ul {
    list-style: none;
}

.pub-modal-body ul li,
.prod-modal-text ul li,
.news-modal-text ul li {
    position: relative;
    padding-left: 20px;
    margin: 10px 0;
}

.pub-modal-body ul li:before,
.prod-modal-text ul li:before,
.news-modal-text ul li:before {
    content: "●";
    position: absolute;
    left: 0;
    color: #AA570A;
    font-weight: bold;
}

.pub-modal-body ol,
.prod-modal-text ol,
.news-modal-text ol {
    list-style: decimal;
}

.pub-modal-body li,
.prod-modal-text li,
.news-modal-text li {
    margin: 10px 0;
    line-height: 1.6;
}

.pub-modal-body strong,
.pub-modal-body b,
.prod-modal-text strong,
.prod-modal-text b,
.news-modal-text strong,
.news-modal-text b {
    font-weight: 700;
    color: #1a1a1a;
}

.pub-modal-body em,
.pub-modal-body i,
.prod-modal-text em,
.prod-modal-text i,
.news-modal-text em,
.news-modal-text i {
    font-style: italic;
    color: #555;
}

.pub-modal-body a,
.prod-modal-text a,
.news-modal-text a {
    color: #AA570A;
    text-decoration: none;
    border-bottom: 2px solid #AA570A;
    transition: all 0.3s ease;
}

.pub-modal-body a:hover,
.prod-modal-text a:hover,
.news-modal-text a:hover {
    color: #8d4708;
    background-color: rgba(170, 87, 10, 0.1);
}

.pub-modal-body blockquote,
.prod-modal-text blockquote,
.news-modal-text blockquote {
    margin: 20px 0;
    padding: 18px 20px;
    border-left: 5px solid #AA570A;
    background: linear-gradient(to right, rgba(170, 87, 10, 0.05), transparent);
    font-style: italic;
    color: #666;
    border-radius: 4px;
}

.pub-modal-body h2,
.pub-modal-body h3,
.pub-modal-body h4,
.prod-modal-text h2,
.prod-modal-text h3,
.prod-modal-text h4,
.news-modal-text h2,
.news-modal-text h3,
.news-modal-text h4 {
    margin: 24px 0 14px 0;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.3;
}

.pub-modal-body h2,
.prod-modal-text h2,
.news-modal-text h2 {
    font-size: 22px;
    border-bottom: 2px solid #AA570A;
    padding-bottom: 8px;
}

.pub-modal-body h3,
.prod-modal-text h3,
.news-modal-text h3 {
    font-size: 19px;
    color: #AA570A;
}

.pub-modal-body h4,
.prod-modal-text h4,
.news-modal-text h4 {
    font-size: 17px;
}

/* Honeypot: hidden from users, still submitted by naive bots. */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.consent-box {
    margin-bottom: 15px;
    text-align: left;
}

.lngbutt.active a {
    opacity: 1;
}

.lngbutt a {
    opacity: 0.65;
}

.lngbutt a:hover,
.lngbutt a:focus {
    opacity: 1;
}

/*=======================================
    PRODUCTS GRID (Showcase Cards)
==================================================*/
.prod-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.prod-col {
    float: none;
    display: flex;
    flex: 0 1 calc(33.333% - 15px);
    margin-bottom: 30px;
}

.prod-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 0;
    background: #fff;
    padding: 0;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    pointer-events: auto;
}

.prod-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

@media (hover: none) and (pointer: coarse) {
    .prod-card:active {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
        opacity: 0.95;
    }
}

.prod-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f5f5f5;
}

.prod-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.prod-info {
    padding: 20px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.prod-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #222;
}

.prod-excerpt {
    flex: 1 1 auto;
    margin: 0 0 10px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    text-align: left;
}

.prod-price {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #AA570A;
    margin-top: 10px;
}

.prod-placeholder {
    color: #ccc;
    font-size: 16px;
    padding: 40px 0;
}

.prod-modal-body {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prod-modal-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.prod-modal-price {
    font-size: 20px;
    font-weight: 700;
    color: #AA570A;
    background-color: #f9f7f4;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #AA570A;
    margin-bottom: 10px;
}

/*=======================================
    NEWS GRID (Timeline Cards)
==================================================*/
.news-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.news-col {
    float: none;
    display: flex;
    flex: 0 1 calc(50% - 10px);
    margin-bottom: 25px;
}

.news-card {
    display: flex;
    width: 100%;
    border: 0;
    background: #fff;
    padding: 0;
    cursor: pointer;
    border-left: 5px solid #AA570A;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    pointer-events: auto;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left-color: #8d4708;
}

@media (hover: none) and (pointer: coarse) {
    .news-card:active {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        opacity: 0.95;
    }
}

.news-left {
    flex: 0 0 120px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 140px;
}

.news-date {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.news-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.news-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 18px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.news-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #222;
}

.news-excerpt {
    flex: 1 1 auto;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.news-placeholder {
    color: #999;
    font-size: 15px;
    padding: 40px 0;
}

.news-modal-body {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-modal-date {
    font-size: 13px;
    font-weight: 700;
    color: #AA570A;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f9f7f4;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

.news-modal-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 10px 0;
}

/*=======================================
    SMALL SCREENS
==================================================*/
@media (max-width: 767px) {
    .head-main {
        font-size: 40px !important;
        padding: 90px 15px 10px 15px;
    }

    .header-logo {
        width: 80%;
    }

    section {
        padding-top: 35px;
    }

    .prod-col {
        flex: 0 1 100%;
    }

    .prod-image {
        height: 200px;
    }

    .news-col {
        flex: 0 1 100%;
    }

    .news-card {
        flex-direction: column;
        border-left: 0;
        border-top: 4px solid #AA570A;
    }

    .news-left {
        flex: 0 0 auto;
        min-height: 50px;
    }

    .news-image {
        height: 180px;
        order: -1;
    }
}

    .g-pad-bottom {
        padding-bottom: 35px;
    }

    h1 {
        font-size: 28px;
        line-height: 1.3;
        padding: 20px 10px 10px 10px;
    }

    h2 {
        font-size: 22px;
    }

    h4 {
        line-height: 1.5;
        padding-bottom: 20px;
    }

    p {
        line-height: 1.7;
    }

    .pub-modal {
        padding: 10px;
    }

    .pub-modal-content {
        padding: 25px 18px;
        max-height: 90vh;
        border-radius: 10px;
    }

    .pub-modal-content h3 {
        font-size: 20px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .pub-modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }

    .prod-modal-img {
        max-height: 250px;
        margin-bottom: 15px;
    }

    .prod-modal-price {
        font-size: 18px;
        padding: 10px 14px;
        margin-bottom: 15px;
    }

    .pub-modal-body,
    .prod-modal-text,
    .news-modal-text {
        font-size: 15px;
        line-height: 1.7;
    }

    .pub-modal-body h2,
    .prod-modal-text h2,
    .news-modal-text h2 {
        font-size: 18px;
    }

    .pub-modal-body h3,
    .prod-modal-text h3,
    .news-modal-text h3 {
        font-size: 16px;
    }

    .pub-modal-body h4,
    .prod-modal-text h4,
    .news-modal-text h4 {
        font-size: 15px;
    }

    .news-modal-img {
        max-height: 250px;
    }
}

    .pub-modal-content h3 {
        font-size: 20px;
    }

    .contact-cls {
        margin-bottom: 30px;
    }

    .lngbutt a {
        padding-top: 8px;
        padding-bottom: 8px;
    }
}
