/*
 Theme Name:   Grindhog Child
 Theme URI:    https://grindhog.com
 Description:  Grindhog child theme
 Author:       Dan Hutten
 Author URI:   https://digitalhexagon.com
 Template:     generatepress
 Version:      0.1
*/

/* Lightbox Overlay Styling */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    will-change: opacity;
}

.custom-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox Image Zoom Animation */
.custom-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.custom-lightbox.is-active img {
    transform: scale(1);
}

/* Close Cursor Hint */
.custom-lightbox {
    cursor: zoom-out;
}

/* Variation Bar */
.gh-variation-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gh-variation-bar__item {
    padding: 0.4rem 1rem;
    border: 1px solid var(--base);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s, color 0.15s;
}

.gh-variation-bar__item:hover:not(.gh-variation-bar__item--active) {
    border-color: var(--accent);
    color: var(--accent);
}

.gh-variation-bar__item--active {
    background-color: var(--accent);
    color: var(--base-3);
    border-color: var(--accent);
}

/* Product metadata block */
.gh-product-meta {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--base);
    margin-bottom: 1.5rem;
}

.gh-product-meta h2.gb-text {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.gh-product-meta p.gb-text {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

/* Model Overview — tab nav */
.gh-overview {
    margin: 2rem 0;
}

.gh-overview__nav {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--base);
    margin-bottom: 1.5rem;
}

.gh-overview__tab {
    padding: 0.6rem 1.4rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
    transition: color 0.15s, border-color 0.15s;
}

.gh-overview__tab:hover {
    color: var(--accent);
}

.gh-overview__tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.gh-overview__panel {
    display: none;
}

.gh-overview__panel.is-active {
    display: block;
}

.gh-overview__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Model variation cards */
.gh-model-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gh-model-card {
    border: 1px solid var(--base);
    border-top: 3px solid var(--accent);
    border-radius: 4px;
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gh-model-card__name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.gh-model-card__type {
    font-size: 0.85rem;
    flex: 1;
}

.gh-model-card__link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.15s;
}

.gh-model-card__link:hover {
    opacity: 0.85;
    color: #fff;
}

/* Application photo gallery grid */
.gh-app-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.gh-app-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 3 / 4;
}

.gh-app-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.2s ease;
}

.gh-app-gallery a:hover img {
    transform: scale(1.04);
}

/* Accordion */

.gb-accordion__item:not(.gb-accordion__item-open) .gb-accordion__content {
    padding: 0;
}

.gb-accordion__toggle[aria-expanded="true"] {
    background-color: var(--accent);
    color: #fff;
}

/* Section accordions — applications + retrofits shortcodes */
.gh-sections {
    margin: 1.5rem 0;
}

details.gh-section {
    border: 1px solid var(--base);
    margin-bottom: 4px;
    border-radius: 4px;
    overflow: hidden;
}

details.gh-section > summary.gh-section__toggle {
    padding: 1rem 1.25rem;
    background: var(--base-2);
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    list-style: none;
    user-select: none;
}

details.gh-section > summary.gh-section__toggle::-webkit-details-marker,
details.gh-section > summary.gh-section__toggle::marker {
    display: none;
    content: '';
}

details.gh-section[open] > summary.gh-section__toggle {
    background: var(--accent);
    color: #fff;
}

.gh-section__content {
    padding: 1.5rem 1.25rem;
    border-top: 1px solid var(--base);
}

.gh-section__desc {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Retrofit cross-reference table */
.gh-retrofit-table-wrap {
    overflow-x: auto;
}

.gh-retrofit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 400px;
}

.gh-retrofit-table th,
.gh-retrofit-table td {
    border: 1px solid var(--base);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    text-align: left;
}

.gh-retrofit-table thead th {
    background: var(--base-2);
    font-weight: 700;
}

.gh-retrofit-table td:first-child {
    width: 40%;
}

.gh-retrofit-table a { color: var(--accent); }
.gh-retrofit-table a:hover { color: var(--accent-2); }

/* Product family summary table */
.gh-product-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.gh-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 500px;
}

.gh-product-table th,
.gh-product-table td {
    border: 1px solid var(--base);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    text-align: left;
}

.gh-product-table thead th {
    background: var(--base-2);
    font-weight: 700;
}

.gh-product-table tbody tr:nth-child(even) {
    background: var(--base-2);
}

.gh-product-table a {
    color: var(--accent);
    font-weight: 600;
}

.gh-product-table a:hover {
    color: var(--accent-2);
}

/* Dropdown menu section headings */
.main-navigation .nav-heading,
.main-navigation .nav-heading:hover {
    color: var(--base);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    cursor: default;
    opacity: 0.6;
    background-color: var(--accent);
}