/* ==========================================================================
   Homepage Featured Section Styles
   ========================================================================== */

/* Homepage Featured Section */
.ohft-homepage-featured {
    margin: 3rem 0;
}

.ohft-homepage-featured__title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-heading-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Homepage Container Base Styles */
.ohft-homepage-container {
    margin-top: 1rem;
}

/* Card View for Homepage */
.ohft-homepage-container--cards {
    display: grid;
    gap: 1.5rem;
    /* Grid columns will be set dynamically by JavaScript based on item count */
}

/* List View for Homepage */
.ohft-homepage-container--list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ohft-homepage-container--list .ohft-page-item__image {
    display: none; /* Hide images in list view */
}

.ohft-homepage-container--list .ohft-page-item__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.ohft-homepage-container--list .ohft-page-item__content {
    flex: 1;
    padding: 0;
}

.ohft-homepage-container--list .ohft-page-item__title {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.ohft-homepage-container--list .ohft-page-item__excerpt {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.ohft-homepage-container--list .ohft-page-item__arrow {
    position: static;
    opacity: 1;
    margin-left: auto;
    flex-shrink: 0;
    transform: none;
}

.ohft-homepage-container--list .ohft-page-item:hover .ohft-page-item__arrow {
    transform: translateX(3px);
}

/* External Link Styling */
.ohft-external-indicator {
    margin-left: 0.5rem;
    color: #768692;
}

.ohft-page-item__title .ohft-external-indicator .material-icon {
    font-size: 0.9rem;
    vertical-align: text-top;
}

/* Placeholder for External Links (Card View) */
.ohft-page-item__image--placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--color-surface-panel) 0%, #e8edee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #768692;
}

.ohft-page-item__placeholder-icon .material-icon {
    font-size: 3rem;
    opacity: 0.6;
}

/* Homepage Notice (when no menu configured) */
.ohft-homepage-notice {
    background: var(--color-surface-panel);
    border: 1px solid var(--color-border-primary);
    border-left: 4px solid var(--nhs-blue);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 2rem 0;
}

.ohft-homepage-notice p {
    margin-bottom: 1rem;
}

.ohft-homepage-notice p:last-child {
    margin-bottom: 0;
}

.ohft-homepage-notice ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.ohft-homepage-notice li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Homepage Hero Section
   ========================================================================== */

.ohft-homepage-hero {
    position: relative;
    min-height: 360px;
    max-height: 600px;
    background-color: var(--nhs-blue); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ohft-homepage-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 94, 184, 0.7) 0%, rgba(0, 94, 184, 0.9) 100%);
    z-index: 1;
}

.ohft-homepage-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--nhs-white);
    max-width: 800px;
    padding: 0 1rem;
    width: 100%;
}

.ohft-homepage-hero__title {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--nhs-white) !important;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ohft-homepage-hero__subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Clean Hero Section (title only, no background) */
.ohft-homepage-hero--clean {
    padding: 3rem 0 2rem;
    background: var(--color-background-secondary);
    border-bottom: 1px solid #e8edee;
}

.ohft-homepage-hero__content--clean {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.ohft-homepage-hero__title--clean {
    font-size: 3rem;
    font-weight: 600;
    color: var(--nhs-blue) !important;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.ohft-homepage-hero__subtitle--clean {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* NHS Colour Theme Support for Hero Overlays */
.ohft-homepage-hero--nhs_blue .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 94, 184, 0.7) 0%, rgba(0, 94, 184, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_dark_blue .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 48, 135, 0.7) 0%, rgba(0, 48, 135, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_bright_blue .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 114, 206, 0.7) 0%, rgba(0, 114, 206, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_light_blue .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(65, 182, 230, 0.7) 0%, rgba(65, 182, 230, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_purple .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(51, 0, 114, 0.7) 0%, rgba(51, 0, 114, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_dark_pink .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(124, 40, 85, 0.7) 0%, rgba(124, 40, 85, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_pink .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(174, 37, 115, 0.7) 0%, rgba(174, 37, 115, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_dark_red .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(138, 21, 56, 0.7) 0%, rgba(138, 21, 56, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_red .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(218, 41, 28, 0.7) 0%, rgba(218, 41, 28, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_orange .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(237, 108, 2, 0.7) 0%, rgba(237, 108, 2, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_warm_yellow .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(255, 184, 28, 0.7) 0%, rgba(255, 184, 28, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_yellow .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(250, 225, 0, 0.7) 0%, rgba(250, 225, 0, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_dark_green .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 103, 71, 0.7) 0%, rgba(0, 103, 71, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_green .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 150, 57, 0.7) 0%, rgba(0, 150, 57, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_light_green .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(120, 190, 32, 0.7) 0%, rgba(120, 190, 32, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_aqua_green .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(0, 164, 153, 0.7) 0%, rgba(0, 164, 153, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_black .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(35, 31, 32, 0.7) 0%, rgba(35, 31, 32, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_dark_grey .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(66, 85, 99, 0.7) 0%, rgba(66, 85, 99, 0.9) 100%) !important;
}

.ohft-homepage-hero--nhs_mid_grey .ohft-homepage-hero__overlay {
    background: linear-gradient(135deg, rgba(118, 134, 146, 0.7) 0%, rgba(118, 134, 146, 0.9) 100%) !important;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .ohft-homepage-hero__title--clean {
        font-size: 2.5rem;
    }
    
    .ohft-homepage-hero__subtitle--clean {
        font-size: 1.125rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ohft-homepage-hero--clean {
        padding: 2rem 0 1.5rem;
    }
    
    .ohft-homepage-hero__title--clean {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .ohft-homepage-hero__subtitle--clean {
        font-size: 1rem;
    }
}

@media print {
    .ohft-homepage-hero--clean {
        padding: 1rem 0;
        border-bottom: 1px solid var(--color-text-primary);
    }
    
    .ohft-homepage-hero__title--clean {
        color: var(--color-text-primary) !important;
        font-size: 2rem;
    }
    
    .ohft-homepage-hero__subtitle--clean {
        color: var(--color-text-primary);
    }
}

/* ==========================================================================
   Homepage Welcome Section
   ========================================================================== */

.ohft-homepage-welcome {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--color-surface-muted) 0%, var(--color-background-secondary) 100%);
    border-bottom: 1px solid #e8edee;
}

.ohft-homepage-welcome__content {
    position: relative;
}

.ohft-homepage-welcome__main {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.ohft-homepage-welcome__main h2 {
    color: var(--color-heading-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.ohft-homepage-welcome__main h3 {
    color: var(--nhs-blue);
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.ohft-homepage-welcome__main p {
    margin-bottom: 1.5rem;
}

.ohft-homepage-welcome__sidebar {
    padding-left: 2rem;
}

/* Info Panel */
.ohft-info-panel {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 2rem;
}

/* Free Text Panel Variant */
.ohft-info-panel--freetext {
    padding: 2rem;
}

.ohft-info-panel--freetext h2,
.ohft-info-panel--freetext h3,
.ohft-info-panel--freetext h4 {
    color: var(--color-heading-primary);
    margin-top: 0;
}

.ohft-info-panel--freetext h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-surface-panel);
}

.ohft-info-panel--freetext h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.ohft-info-panel--freetext h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.ohft-info-panel--freetext p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.ohft-info-panel--freetext ul,
.ohft-info-panel--freetext ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.ohft-info-panel--freetext li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ohft-info-panel--freetext a {
    color: var(--color-text-link);
    text-decoration: underline;
}

.ohft-info-panel--freetext a:hover {
    color: var(--color-text-link-hover);
    text-decoration: none;
}

.ohft-info-panel--freetext a:focus {
    outline: 3px solid var(--color-focus-background);
    outline-offset: 0;
    background: var(--color-focus-background);
    color: var(--color-focus-text);
    text-decoration: none;
}

.ohft-info-panel--freetext blockquote {
    border-left: 4px solid var(--nhs-blue);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

/* Full Width Content (when panel is hidden) */
.ohft-homepage-welcome .nhsuk-grid-column-full .ohft-homepage-welcome__main {
    max-width: none;
    font-size: 1.125rem;
}

.ohft-info-panel__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-heading-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-surface-panel);
}

.ohft-info-panel__title .material-icon {
    font-size: 1.5rem;
}

.ohft-info-item {
    margin-bottom: 2rem;
}

.ohft-info-item:last-child {
    margin-bottom: 0;
}

.ohft-info-item h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.ohft-info-item p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.ohft-info-item p:last-child {
    margin-bottom: 0;
}

.ohft-info-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-link);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.ohft-info-link:hover {
    border-bottom-color: var(--color-text-link);
    text-decoration: none;
}

.ohft-info-link:focus {
    outline: 3px solid var(--color-focus-background);
    outline-offset: 2px;
    background: #eff6ff;
    text-decoration: none;
}

.ohft-info-link .material-icon {
    font-size: 1.25rem;
}

/* Button Styles */
.ohft-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.ohft-button--secondary {
    color: var(--nhs-white);
    background-color: var(--nhs-blue);
    border-color: var(--nhs-blue);
}

.ohft-button--secondary:hover {
    background: var(--color-focus-background);
    color: var(--color-focus-text);
    text-decoration: none;
    border-color: var(--color-focus-border);
}

.ohft-button--secondary:focus {
    outline: 3px solid var(--color-focus-background);
    outline-offset: 0;
    background: var(--color-focus-background);
    color: var(--color-focus-text);
    border-color: var(--color-focus-border);
    text-decoration: none;
}

/* Additional Content */
.ohft-additional-content {
    margin: 3rem 0;
    padding: 2rem 2rem 1rem;
    background: var(--color-surface-card);
    border-radius: 8px;
    border-left: 4px solid var(--nhs-blue);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Large Desktop - Allow more columns for many items */
@media (min-width: 1400px) {
    .ohft-homepage-container--cards[data-item-count="5"] {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .ohft-homepage-container--cards[data-item-count="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ohft-homepage-container--cards[data-item-count="7"] {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .ohft-homepage-container--cards[data-item-count="8"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1199px) {
    .ohft-homepage-featured__title {
        font-size: 1.75rem;
    }
    
    .ohft-hero-content h1 {
        font-size: 2.5rem;
    }
    
    .ohft-hero-content p {
        font-size: 1.125rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ohft-homepage-featured {
        margin: 2rem 0;
    }
    
    .ohft-homepage-featured__title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .ohft-hero {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    .ohft-hero-content h1 {
        font-size: 2rem;
    }
    
    .ohft-hero-content p {
        font-size: 1rem;
    }
    
    .ohft-homepage-notice {
        padding: 1rem;
        margin: 1rem 0;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ohft-view-switcher {
        display: none;
    }
    
    .ohft-homepage-container--cards,
    .ohft-homepage-container--list {
        display: block;
    }
    
    .ohft-page-item {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid var(--color-text-primary);
    }
    
    .ohft-page-item__image,
    .ohft-page-item__arrow {
        display: none;
    }
    
    .ohft-page-item__link::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #666;
    }
    
    .ohft-hero {
        background: none !important;
        color: var(--color-text-primary) !important;
        padding: 1rem 0;
    }
    
    .ohft-hero::before {
        display: none;
    }
    
    .ohft-hero-content h1 {
        color: var(--color-text-primary) !important;
    }
}