/*
Theme Name: StreamTheme
Theme URI: https://example.com/streamtheme
Author: Your Name
Author URI: https://example.com
Description: A theme for streaming sports and TV channels.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: streaming, video, sports, tv
Text Domain: streamtheme
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0 Normalize
2.0 Typography
3.0 General Layout & Structure
4.0 Header & Navigation
5.0 Main Content & Articles
6.0 Footer
7.0 Homepage Sections
8.0 Single Page Layouts
9.0 Search, Archives & 404
10.0 Media Queries (Responsive Design)
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1.0 Normalize & Box Sizing
--------------------------------------------------------------*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #333;
}

/*--------------------------------------------------------------
3.0 General Layout & Structure
--------------------------------------------------------------*/
.site {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    padding: 2em;
    flex-grow: 1; /* This makes the content area expand */
}

/* Screen reader text */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/*--------------------------------------------------------------
4.0 Header & Navigation
--------------------------------------------------------------*/
.site-header {
    padding: 1.5em 2em;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2em;
}

.site-title {
    font-size: 1.5em;
    margin: 0;
}
.site-title a {
    font-weight: bold;
    color: #23282d;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5em;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-navigation li {
    margin-left: 1.5em;
}

.main-navigation a {
    font-weight: 500;
    color: #555;
}

/*-- 4.1 Header Search --*/
.header-search .search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
}

.header-search .search-field {
    border: none;
    padding: 0.5em 1em;
    outline: none;
}

.header-search .search-submit {
    background-color: #0073aa;
    border: none;
    color: #fff;
    padding: 0.5em 1em;
    cursor: pointer;
}


/*--------------------------------------------------------------
5.0 Main Content & Articles
--------------------------------------------------------------*/
.site-main {
    display: block; /* Reverting to block for single pages */
}

.post {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
}

.post .entry-header,
.post .entry-content,
.post .entry-footer {
    padding: 1.5em;
}

.post .entry-header {
    padding-bottom: 0;
}

.post .entry-title {
    font-size: 1.4em;
    margin: 0;
}

.post img.wp-post-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/*--------------------------------------------------------------
6.0 Footer
--------------------------------------------------------------*/
.site-footer {
    padding: 2em;
    background-color: #23282d;
    color: #fff;
    text-align: center;
    font-size: 0.9em;
}

.site-footer a {
    color: #00a0d2;
}

/*--------------------------------------------------------------
7.0 Homepage Sections
--------------------------------------------------------------*/
.homepage-section {
    margin-bottom: 3em;
}

.section-title {
    font-size: 1.8em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.3em;
    margin-bottom: 1em;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5em;
}

.grid-item {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.grid-item-link {
    display: block;
    color: inherit;
}

.grid-item .post-thumbnail {
    background-color: #eee;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item .post-thumbnail.placeholder span {
    font-weight: bold;
    color: #555;
    text-align: center;
    padding: 1em;
}

.grid-item .entry-header {
    padding: 1em 1.25em;
}

.grid-item .entry-title {
    font-size: 1.1em;
    margin: 0;
}

/*--------------------------------------------------------------
8.0 Single Page Layouts
--------------------------------------------------------------*/
/*-- 8.1 Single Channel Page --*/
.channel-single .channel-player-wrapper {
    background-color: #000;
    margin-bottom: 2em;
}

.channel-single .player-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.channel-single .player-placeholder p {
    margin: 0;
    font-size: 1.2em;
}

.channel-single .entry-header {
    margin-bottom: 1em;
}

.channel-single .entry-title {
    font-size: 2.2em;
}

.player-iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9; /* This sets the 16:9 shape */
}

.player-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/*-- 8.2 Single Show/Event Page --*/
.show-single .show-poster {
    margin-bottom: 2em;
}

.show-single .show-poster img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.show-single .entry-header {
    margin-bottom: 1em;
    text-align: center;
}

.show-single .entry-title {
    font-size: 2.5em;
}

/*-- 8.3 Event Meta Info --*/
.event-meta {
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.5em;
    margin-bottom: 2em;
    display: flex;
    flex-direction: column;
    gap: 1em;
    text-align: center;
    font-size: 1.1em;
}

.event-meta span {
    display: block;
}

/*--------------------------------------------------------------
9.0 Search, Archives & 404
--------------------------------------------------------------*/
.page-header {
    margin-bottom: 2em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1em;
}

.page-title {
    font-size: 2em;
}

.search-result-item {
    margin-bottom: 2em;
    padding-bottom: 2em;
    border-bottom: 1px solid #e0e0e0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.error-404 {
    text-align: center;
}

.error-404 .page-header {
    border-bottom: none;
}

.error-404 .page-content .search-form {
    margin: 2em auto;
    max-width: 400px;
}

/*--------------------------------------------------------------
10.0 Media Queries (Responsive Design)
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
    .site-header {
        flex-direction: column;
        text-align: center;
    }

    .site-branding {
        margin-bottom: 1em;
    }
	
	.header-right {
		flex-direction: column;
	}

    .main-navigation ul {
        justify-content: center;
    }

    .main-navigation li {
        margin: 0 0.75em;
    }

    .site-content {
        padding: 1em;
    }
}
