/**
 * Blocksy Child Theme Custom Styles
 * Archive and Single Template Styles
 * VERSION 1.3.0 - Updated Grid Layouts
 */

/* Archive Headers */
.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.archive-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.archive-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary, #666);
}

/* Grid Layouts */
.content-area .entries {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.content-area .events-grid,
.content-area .gallery-grid,
.content-area .leadership-grid,
.content-area .schools-grid,
.content-area .departments-grid,
.content-area .programmes-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (max-width: 1024px) {
    .content-area .events-grid,
    .content-area .gallery-grid,
    .content-area .leadership-grid,
    .content-area .schools-grid,
    .content-area .departments-grid,
    .content-area .programmes-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 1400px) {
    .content-area .events-grid,
    .content-area .gallery-grid,
    .content-area .leadership-grid,
    .content-area .schools-grid,
    .content-area .departments-grid,
    .content-area .programmes-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Event Cards */
.event-card {
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.event-card .entry-thumbnail {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.event-card .entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.event-card:hover .entry-thumbnail img {
    transform: scale(1.05);
}

.event-date-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--theme-palette-color-1, #3366cc);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.event-date-badge .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.event-date-badge .month {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
}

.event-meta,
.event-details-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background-color, #f5f5f5);
    border-radius: 8px;
}

.meta-item,
.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gallery */
.gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 280px;
}

.gallery-link {
    display: block;
    height: 100%;
}

.gallery-preview {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.gallery-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-preview img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1.5rem;
    transform: translateY(0);
    transition: transform 0.3s;
}

.gallery-overlay .entry-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: white;
}

.gallery-overlay .image-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

.gallery-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-image-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-image-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Leadership */
.leadership-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--theme-palette-color-1, #3366cc);
}

.leadership-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.leadership-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.leader-photo {
    overflow: hidden;
}

.leader-photo img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s;
}

.leadership-card:hover .leader-photo img {
    transform: scale(1.05);
}

.leader-info {
    padding: 1.5rem;
}

.leader-name,
.entry-title {
    margin-bottom: 0.5rem;
}

.qualifications {
    font-size: 0.875rem;
    color: var(--theme-palette-color-1, #3366cc);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.position {
    color: var(--color-text-secondary, #666);
    margin-bottom: 1rem;
}

/* HOD/Dean Section - Compact on Desktop */
.hod-section .leadership-card,
.dean-section .leadership-card {
    display: flex;
    flex-direction: row;
    max-width: 600px;
}

.hod-section .leader-photo,
.dean-section .leader-photo {
    flex: 0 0 200px;
    width: 200px;
}

.hod-section .leader-photo img,
.dean-section .leader-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hod-section .leader-info,
.dean-section .leader-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 640px) {
    .hod-section .leadership-card,
    .dean-section .leadership-card {
        flex-direction: column;
    }
    
    .hod-section .leader-photo,
    .dean-section .leader-photo {
        flex: 0 0 auto;
        width: 100%;
        max-height: 300px;
    }
}

.leadership-profile {
    max-width: 900px;
    margin: 0 auto;
}

.profile-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .profile-header {
        grid-template-columns: 1fr;
    }
}

.contact-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-color, #f5f5f5);
    border-radius: 8px;
}

.contact-item {
    margin-bottom: 0.5rem;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--theme-palette-color-2, #666);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Schools & Departments */
.school-card,
.department-card,
.programme-card {
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.school-card:hover,
.department-card:hover,
.programme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Archive Card Images - Fixed Height */
.school-card .entry-thumbnail,
.department-card .entry-thumbnail,
.programme-card .entry-thumbnail {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.school-card .entry-thumbnail img,
.department-card .entry-thumbnail img,
.programme-card .entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.school-card:hover .entry-thumbnail img,
.department-card:hover .entry-thumbnail img,
.programme-card:hover .entry-thumbnail img {
    transform: scale(1.05);
}

.entry-content-wrapper {
    padding: 2rem !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entry-content-wrapper .entry-header {
    margin-bottom: 1rem;
}

.entry-content-wrapper .entry-title {
    font-size: 1.375rem !important;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

.entry-content-wrapper .entry-title a {
    color: var(--heading-color, #333);
    text-decoration: none;
    transition: color 0.3s;
}

.entry-content-wrapper .entry-title a:hover {
    color: var(--theme-palette-color-1, #3366cc);
}

.entry-content-wrapper .entry-summary {
    flex: 1;
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary, #666);
    font-size: 1rem !important;
    line-height: 1.7;
}

.entry-content-wrapper .ct-button {
    margin-top: auto;
    align-self: flex-start;
}

.school-short-name {
    font-size: 0.9rem;
    color: var(--theme-palette-color-1, #3366cc);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.school-dean,
.department-school,
.programme-department {
    font-size: 0.9rem;
    color: var(--color-text-secondary, #666);
    margin-bottom: 1rem;
}

.school-dean a,
.department-school a,
.programme-department a {
    color: var(--theme-palette-color-1, #3366cc);
    text-decoration: none;
    font-weight: 500;
}

.school-dean a:hover,
.department-school a:hover,
.programme-department a:hover {
    text-decoration: underline;
}

/* Hero Sections */
.ct-hero-section {
    background-size: cover;
    background-position: center;
    padding: 6rem 0;
    margin-bottom: 2rem;
    position: relative;
}

.ct-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ct-hero-section .ct-container {
    position: relative;
    z-index: 1;
}

.ct-footer {
    margin-top: 2rem;
}
.hero-title {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--theme-palette-color-1, #3366cc);
}

section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Vision & Mission */
.vision-mission {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.vision,
.mission {
    padding: 2rem;
    border: 2px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
}

/* Programme Details */
.programme-details {
    margin: 2rem 0;
}

.detail-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color, #f5f5f5);
    border-radius: 8px;
}

.programme-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.award-type,
.duration {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--theme-palette-color-1, #3366cc);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Course Tables */
.courses-section {
    margin: 3rem 0;
}

.level-section {
    margin-bottom: 3rem;
}

.semester-section {
    margin-bottom: 2rem;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.courses-table thead {
    background: var(--theme-palette-color-1, #3366cc);
    color: white;
}

.courses-table th,
.courses-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color, #e5e5e5);
}

.courses-table tbody tr:nth-child(even) {
    background: var(--background-color, #f9f9f9);
}

/* Departments & Programmes Lists */
.departments-list {
    list-style: none;
    padding: 0;
}

.departments-list li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.departments-list li:last-child {
    border-bottom: none;
}

.departments-list a {
    color: var(--theme-palette-color-1, #3366cc);
    text-decoration: none;
    font-weight: 500;
}

.departments-list a:hover {
    text-decoration: underline;
}

/* Entry Meta */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary, #666);
    margin: 1rem 0;
}

.entry-meta .separator {
    margin: 0 0.5rem;
}

/* News Archive - List Layout */
.entries > article {
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
}

.entries > article:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.entries > article .entry-thumbnail {
    width: 100%;
    height: 100%;
    min-height: 250px;
    overflow: hidden;
}

.entries > article .entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.entries > article:hover .entry-thumbnail img {
    transform: scale(1.05);
}

.entries > article .entry-header,
.entries > article .entry-summary,
.entries > article .ct-button {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.entries > article .entry-header {
    padding-top: 1.5rem;
}

.entries > article .entry-summary {
    padding-bottom: 1rem;
    color: var(--color-text-secondary, #666);
    line-height: 1.6;
}

.entries > article .ct-button {
    padding-bottom: 1.5rem;
}

.entries > article .entry-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.entries > article .entry-title a {
    color: var(--heading-color, #333);
    text-decoration: none;
}

.entries > article .entry-title a:hover {
    color: var(--theme-palette-color-1, #3366cc);
}

@media (max-width: 768px) {
    .entries > article {
        grid-template-columns: 1fr;
    }
    
    .entries > article .entry-thumbnail {
        height: 200px;
        min-height: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .archive-header .page-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .entries {
        grid-template-columns: 1fr;
    }
    
    .event-details-bar {
        flex-direction: column;
    }
}

/* Welcome Section */
.welcome-section {
    padding: 4rem 0;
    background: var(--background-color, #f9f9f9);
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.welcome-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--theme-palette-color-1, #3366cc);
}

.welcome-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .welcome-grid {
        grid-template-columns: 1fr;
    }
}

/* About Section */
.about-section {
    padding: 4rem 0;
    text-align: center;
}

.about-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--heading-color, #333);
}

.about-content {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.about-cta {
    margin-top: 2rem;
}

/* Why Choose Us */
.why-choose-us {
    padding: 4rem 0;
    background: white;
}

.why-choose-us .section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--heading-color, #333);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--background-color, #f9f9f9);
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    color: var(--theme-palette-color-1, #3366cc);
    margin-bottom: 1rem;
}

.feature-icon .dashicons {
    width: 60px;
    height: 60px;
    font-size: 60px;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--heading-color, #333);
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Admissions CTA */
.admissions-cta {
    padding: 4rem 0;
    background: var(--theme-palette-color-1, #3366cc);
    color: white;
}

.admissions-content {
    margin: 0 auto;
}

.admissions-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: white;
}

.admissions-text {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.admissions-text ul {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.admissions-text li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.admissions-text li:before {
    content: "•";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.ct-button-primary {
    background: white;
    color: var(--theme-palette-color-1, #3366cc);
    font-weight: 600;
}

.ct-button-primary:hover {
    background: #f0f0f0;
}

/* Quick Links */
.quick-links-widget {
    background: var(--background-color, #f9f9f9);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.quick-links-widget h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--heading-color, #333);
    border-bottom: 2px solid var(--theme-palette-color-1, #3366cc);
    padding-bottom: 0.5rem;
}

.quick-links-list {
    list-style: none;
    padding: 0;
}

.quick-links-list a {
    display: block;
    padding: 0.75rem 0;
    color: var(--link-color, #3366cc);
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
    transition: padding-left 0.3s;
}

.quick-links-list a:hover {
    padding-left: 1rem;
    color: var(--link-hover-color, #2255aa);
}

.quick-links-list a:last-child {
    border-bottom: none;
}

/* ========================================
   ARCHIVE GRID OVERRIDES - FORCE APPLY
   ======================================== */

/* Force 2-column layout on all archive grids */
.ct-container .content-area .entries.schools-grid,
.ct-container .content-area .entries.departments-grid,
.ct-container .content-area .entries.programmes-grid,
.ct-container .content-area .entries.events-grid,
.ct-container .content-area .entries.leadership-grid,
.ct-container .content-area .entries.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .ct-container .content-area .entries.schools-grid,
    .ct-container .content-area .entries.departments-grid,
    .ct-container .content-area .entries.programmes-grid,
    .ct-container .content-area .entries.events-grid,
    .ct-container .content-area .entries.leadership-grid,
    .ct-container .content-area .entries.gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Force card styling */
.school-card,
.department-card,
.programme-card,
.event-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Force content padding and sizing */
.school-card .entry-content-wrapper,
.department-card .entry-content-wrapper,
.programme-card .entry-content-wrapper,
.event-card .entry-content-wrapper {
    padding: 2rem !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.school-card .entry-title,
.department-card .entry-title,
.programme-card .entry-title,
.event-card .entry-title {
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}
