/* ==========================================================================
   In The Press Block
   ========================================================================== */
.content-block.block-width-full-width.in-the-press-block {
  padding-left: 0;
  padding-right: 0;
}


/* Block heading */
.in-the-press-block .press-block-heading {
	text-align: center;
	text-transform: uppercase;
	font-family: 'landmark inline', sans-serif;
	max-width: 1080px;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 40px;
}

/* Press Grid Layout */
.in-the-press-block .press-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto;
}

/* Individual press item */
.in-the-press-block .press-item {
    position: relative;
    aspect-ratio: 5 / 3;
    border: 1px solid #e0e0e0;
    margin-top: -1px;
    margin-left: -1px;
    overflow: hidden;
}

/* Reset margin for first row and first column to maintain outer border */
.in-the-press-block .press-item:nth-child(-n+3) {
    margin-top: 0;
}

.in-the-press-block .press-item:nth-child(3n+1) {
    margin-left: 0;
}

/* Inner container for positioning */
.in-the-press-block .press-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Logo container */
.in-the-press-block .press-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
}

.in-the-press-block .press-logo img {
max-width: 70%;
  max-height: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Overlay styles */
.in-the-press-block .press-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--secondary-colour);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    box-sizing: border-box;
}

/* Show overlay on hover (desktop) */
.in-the-press-block .press-item:hover .press-overlay {
    opacity: 1;
    visibility: visible;
}

/* Show overlay when active (mobile tap) */
.in-the-press-block .press-item.active .press-overlay {
    opacity: 1;
    visibility: visible;
}

/* Text styling within overlay */
.in-the-press-block .press-text {
    color: #ffffff;
    text-align: center;
    max-height: 100%;
    overflow-y: auto;
    padding: 0 12px;
}

.in-the-press-block .press-text p {
    color: #ffffff;
    margin: 0;
}

/* Close button - hidden by default, shown on mobile */
.in-the-press-block .press-overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.in-the-press-block .press-overlay-close:hover,
.in-the-press-block .press-overlay-close:focus {
    opacity: 1;
}

/* ==========================================================================
   Tablet Breakpoint (2 columns)
   ========================================================================== */
@media screen and (max-width: 991px) {
    .in-the-press-block .press-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Adjust margins for 2-column layout */
    .in-the-press-block .press-item:nth-child(-n+3) {
        margin-top: -1px;
    }
    
    .in-the-press-block .press-item:nth-child(3n+1) {
        margin-left: -1px;
    }
    
    /* First row */
    .in-the-press-block .press-item:nth-child(-n+2) {
        margin-top: 0;
    }
    
    /* First column */
    .in-the-press-block .press-item:nth-child(2n+1) {
        margin-left: 0;
    }
}

/* ==========================================================================
   Mobile Breakpoint (1 column)
   ========================================================================== */
@media screen and (max-width: 768px) {
    .in-the-press-block .press-block-heading {
        margin-bottom: 30px;
        font-size: 24px;
    }
    
    .in-the-press-block .press-grid {
        grid-template-columns: 1fr;
    }
    
    /* Reset all margins for single column */
    .in-the-press-block .press-item {
        margin-left: 0;
        margin-top: -1px;
    }
    
    .in-the-press-block .press-item:first-child {
        margin-top: 0;
    }
    
    /* Show close button on mobile */
    .in-the-press-block .press-overlay-close {
        display: flex;
    }
    
    /* Disable hover effect on touch devices - only use tap */
    .in-the-press-block .press-item:hover .press-overlay {
        opacity: 0;
        visibility: hidden;
    }
    
    /* Active state takes priority */
    .in-the-press-block .press-item.active .press-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .in-the-press-block .press-text {
        font-size: 13px;
        padding-top: 15px;
    }
    
    .in-the-press-block .press-logo {
        padding: 20px;
    }
}

/* ==========================================================================
   Editor Styles
   ========================================================================== */
.editor-styles-wrapper .in-the-press-block .press-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media screen and (max-width: 991px) {
    .editor-styles-wrapper .in-the-press-block .press-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .editor-styles-wrapper .in-the-press-block .press-grid {
        grid-template-columns: 1fr;
    }
}
