/* ======================
1. Style for overall page
====================== */

* {
    font-family: Georgia, 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green: #203c26;
    --dark-brown: #382F2D;
    --white: #ffffff;
    --lightgreen: #2c5234;
    --accent: #8B4513; /* Brown */
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #edeef0;
}

.card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ======================
2. Header Styling 
====================== */

.header {
    background-color: var(--white);
    border-bottom: 4px solid var(--accent);
    display: flex;
    flex-direction: column;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 10px 20px;
    width: 100%;
}

/* 2.1 Logo and Title Sections */
.logo-container {
    flex: 1;
    z-index: 2;
    display: flex;
    align-items: center;
}

.logo {
    width: 100px;
    height: auto;
}

.title-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.title {
    font-size: clamp(2rem, 8vw, 5rem);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
}

.edition-text {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-top: 5px;
    width: fit-content;
}

/* 2.2 Weather and Clock Section */
.clock-weather-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative; 
}

#weather-trigger {
    position: relative;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background 0.3s ease;
    width: fit-content;
    text-align: center;
}

#weather-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.clock-style {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.2;
}

.weather-style {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

#forecast-dropdown {
    display: none;
    position: absolute;
    top: 105%; /* Sits just below the trigger */
    left: 50%;
    transform: translateX(-50%); /* Perfectly centers the dropdown under the text */
    background-color: #ffffff;
    min-width: 260px;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    z-index: 9999;
}

#forecast-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}

.forecast-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f9f9f9;
}

.forecast-row:last-child { 
    border-bottom: none; 
}

/* ======================
3. Navigation 
====================== */

.nav-bar {
    background-color: var(--lightgreen);
    padding: 10px;
    width: 100%;
}

.nav-bar ul {
    display: flex;
    list-style: none;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-bar li {
    background-color: var(--white);
    color: var(--lightgreen);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 20px;
    transition: 0.3s;
    position: relative; 
}

.nav-bar li a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-bar li:hover {
    background-color: var(--green);
    color: var(--white);
}

/* --- Dropdown Specific Logic --- */

/* 1. Hide the menu by default */
.dropdown-menu {
    display: none !important; /* Forces it to stay hidden */
    position: absolute;
    top: 100%;
    left: -50%;
    background-color: var(--white);
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
    z-index: 1000;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    padding: 0;
    list-style: none;
}

/* 2. Show on hover */
.dropdown:hover .dropdown-menu {
    display: block !important;
}

/* 3. RESET the dropdown items (so they don't look like pills) */
.dropdown-menu li {
    background-color: transparent !important; /* Removes white pill background */
    color: var(--green) !important;
    padding: 0 !important; /* Removes pill padding */
    border-radius: 0 !important; /* Removes pill rounding */
    width: 100%;
    display: block;
}

.dropdown-menu li a {
    padding: 12px 20px;
    width: 100%;
    display: block;
    transition: 0.2s;
    text-align: left;
}

.dropdown-menu li a:hover {
    background-color: #f1f1f1 !important;
    color: var(--accent) !important;
}

.dropdown > a::after {
    content: ' ▼';
    font-size: 0.6rem;
    vertical-align: middle;
    opacity: 0.7;
}

/* ======================
4. Main Content 
====================== */

.content-container {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr; 
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding: 40px 4%;
    margin: 0;
    flex: 1;
}

.left-column h2 {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
    border-bottom: 3px double var(--accent);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.left-column ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.left-column li {
    padding: 15px 0;
    font-size: 1.1rem;
    font-weight: 550;
    line-height: 1.4;
    border-bottom: 1px solid #ddd;
    transition: 0.2s;
    cursor: pointer;
}

.left-column li a {
    text-decoration: none;
    color: inherit;
}

.left-column li:hover {
    color: var(--lightgreen);
    transform: translateY(-2px);
}

.left-column {
    gap: 40px;
}

.brief-summary {
    font-size: .9rem;
    color: #4a4a4a;
    margin: 10px 0 20px 0;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.daily-brief-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.brief-header {
    padding: 15px;
}

.brief-date {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.brief-content {
    padding: 15px;
}

.sidebar-brief-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.brief-text-content {
    flex-grow: 1;
}

.brief-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.brief-item:last-child {
    border-bottom: none;
}

.brief-item h4 {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    color: #333;
    line-height: 1.3;
}

.brief-link {
    font-size: 0.8rem;
    color: var(--green);
    text-decoration: none;
    font-weight: bold;
}

.brief-link:hover {
    text-decoration: underline;
}

.brief-footer-btn {
    display: block;
    background-color: var(--green);
    color: white;
    text-align: center;
    padding: 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.3s;    
    width: 100%; 
    cursor: pointer;
}

.brief-footer-btn:hover {
    background-color: var(--lightgreen);
    transform: scale(1.05);
}

.loading-shimmer {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.middle-column h2 {
    text-align: center;
    margin-bottom: 15px;
}

.middle-column p {
    text-align: left;
    line-height: 1.6;
}

.second-middle-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    padding-top: 20px;
}

.story-one, .story-two {
    text-align: center;
}

.main-article-image {
    width: 100%;
    margin-bottom: 20px;
}

.main-article-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    max-height: 500px;
    display: block;
}

.main-article-image figcaption {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.main-article-content h2 {
    font-size: 2.5rem;
    margin: 10px 0;
    line-height: 1.1;
}

.byline {
    font-size: 0.9rem;
}

.article-body p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-indent: 30px;
}

.second-middle-column .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.secondary-story-image img {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.teaser-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: left;
}

.secondary-story-content h3 {
    font-size: 1.4rem;
    line-height: 1.2;
    margin: 10px 0;
}

.secondary-story-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.left-column, .right-column {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.right-column {
    align-self: start;
    gap: 40px;
}

.right-column h2 {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
    border-bottom: 3px double var(--accent);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.right-column ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.right-column li {
    padding: 15px 0;
    font-size: 1.1rem;
    font-weight: 550;
    line-height: 1.4;
    border-bottom: 1px solid #ddd;
    transition: 0.2s;
    cursor: pointer;
}

.right-column li a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.right-column li:hover {
    color: var(--lightgreen);
    transform: translateY(-2px);
}

#breaking-content .brief-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    transition: background 0.3s;
}

#breaking-content .brief-item:last-child {
    border-bottom: none;
}

#breaking-content .brief-item small {
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#breaking-content .brief-item h4 {
    font-size: .9;
    line-height: 1.1;
    color: #1a1a1a;
    margin: 0 !important;
}

.sidebar-card {
    width: 100%;
}

.read-more {
    display: block;
    background-color: var(--lightgreen);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.read-more a {
    text-decoration: none;
    color: inherit;
}

.read-more-small {
    display: block;
    background-color: var(--lightgreen);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
}

.read-more-small a {
    text-decoration: none;
    color: inherit;
}

.read-more:hover {
    background-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.read-more-small:hover {
    background-color: var(--green);
    transform: scale(1.05);
}

.read-more:active {
    transform: translateY(0);
}

/* ======================
5. Footer Styling 
====================== */

.footer {
    background-color: var(--green);
    border-top: 4px solid var(--accent);
    color: var(--white);
    padding: 40px 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-info {
    flex: 1;
    text-align: left;
    font-size: clamp(0.8rem, 1.2vw, 1rem) !important;
    line-height: 1.75;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-logo-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.footer-logo {
    width: 200px;
    height: auto;
}

.footer-admin-login {
    flex: 1;
    text-align: right;
    font-size: clamp(0.8rem, 1.2vw, 1rem) !important;
}

.footer-admin-login p {
    cursor: pointer;
    text-decoration: underline;
    opacity: .8;
    transition: 0.3s;
}

.footer-admin-login p:hover {
    opacity: 1;
    color: var(--accent)
}

/* ======================
6. Header Styling 
====================== */

.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px); 
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-card {
    width: 90%;
    max-width: 400px;
    position: relative;
    padding: 30px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--green);
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.cancel-btn {
    background: #eee;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.error-text {
    color: #c0392b;
    font-size: 0.85rem;
    margin-top: 10px;
    display: none;
}
/* ======================
7. Article Template Layout
====================== */

.main-article-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 4%;
}

.article-header h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.article-header .byline {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    display: block;
}

.template-image {
    width: 100%;
    margin: 20px 0;
}

.template-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.template-image figcaption {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.article-full-text {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 20px;
    color: #333;
}

.article-full-text p {
    text-indent: 30px;
}

.article-full-text ul li {
    list-style-type: none;
}

.return-home {
    display: block;
    background-color: var(--lightgreen);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.return-home:hover {
    background-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.return-home a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ======================
8. Staff Page Style
====================== */

.staff-page {
    display: block !important;
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    color: var(--green);
    border-bottom: 3px double var(--accent);
    margin: 40px 0 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: start;
}

.staff-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: var(--white);
    height: auto;
    overflow: hidden;
    will-change: transform, max-height;
}

.staff-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 100;
}

.staff-bio-expand {
    max-height: 0;
    opacity: 0;
    transition: all 0.5s ease;
    margin-top: 0;
}

.staff-card:hover .staff-bio-expand {
    max-height: 550px;
    opacity: 1;
    margin-top: 15px;
}

.staff-image {
    height: 100px;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    border: 3px solid var(--lightgreen);
    background-color: var(--white);
    overflow: hidden;
    position: relative;
    transition: 0.4s ease;
}

.staff-image img {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.logo-fit img {
    object-fit: contain;
    padding: 5px;
}

.staff-info h3 {
    margin-bottom: 5px;
    color: var(--green);
}

.staff-info {
    display: flex;
    flex-direction: column;
}

.staff-position {
    font-weight: bold;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.staff-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    text-align: left;
}

/*If the face on the picture is towards the right*/
.right-pos img {
    object-position: 85% 15%;
}

/*If the face on the picture is towards the left*/
.left-pos img {
    object-position: 10% 15%;
}

/* ======================
9. Responsive Logic
====================== */

/* Mobile Adjustments (under 768px) */
@media (max-width: 767px) {
    .header-top {
        flex-direction: column; /* Stack logo above title on very small screens */
        justify-content: center;
        min-height: auto;
        padding: 20px 0;
    }

    .title {
        margin-top: 10px;
        text-align: center;
        width: 100%;
    }

    .edition-text {
        position: static;
        transform: none;
        text-align: center;
        font-size: 0.6rem;
        margin-top: 10px;
    }

    .clock-style {
        position: static;
        text-align: center;
        margin-top: 5px;
        font-size: 0.75rem !important;
        width: 100%;
        min-width: auto;
    }

    .content-container {
        grid-template-columns: 1fr;
    }
    .middle-column {
        order: 1;
    }
    .right-column {
        order: 2;
    }
    .left-column {
        order: 3;
    }

    .main-article-content h2 {
        font-size: 1.8rem;
    }

    .footer {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-info, .footer-admin-login {
        text-align: center;
        width: 100%;
    }

    .second-middle-column {
        grid-template-columns: 1fr;
    }

    .main-article-container {
        grid-template-columns: 1fr;
    }

    .staff-grid {
        grid-template-columns: 1fr;
    }

    .staff-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .clues-container {
        grid-template-columns: 1fr; /* Stack Across and Down on top of each other */
        gap: 20px;
    }

    .controls {
        flex-direction: column; /* Stack Check/Reset buttons */
        gap: 10px;
        width: 100%;
    }

    .controls .read-more {
        width: 100%; /* Full width buttons are easier to tap with thumbs */
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .content-container {
        grid-template-columns: 3fr 1fr;
    }
    .middle-column {
        order: 1;
    }

    .second-middle-column {
        gap: 15px;
    }

    .right-column {
        order: 2;
    }

    .left-column {
        grid-column: span 2; /* Full width at bottom */
        order: 3;
    }
 
    .logo {
        width: 120px; /* Bigger logo for bigger screens */
    }

    .main-article-container {
        grid-template-columns: 1fr;
    }

    .staff-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px; /* Slightly tighter gap for tablets */
    }
    
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .content-container {
        grid-template-columns: 1fr 4fr 1fr;
    }
    .left-column { 
        order: 1; 
    }

    .middle-column { 
        order: 2; 
    }

    .second-middle-column {
        grid-template-columns: 1fr 1fr;
    }

    .right-column { 
        order: 3; 
    }

    .logo {
        width: 120px;
    }
}

@media (max-width: 400px) {
    .game-card {
        padding: 10px;
    }

    .grid-scroll-container {
        margin-left: -10px; 
        margin-right: -10px;
        width: calc(100% + 20px); 
    }

    .grid {
        gap: 1px; 
        border-width: 1px;
    }
}

@media (max-width: 767px) {
    #weather-trigger {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 10px; /* Adds a little buffer */
    }

    #forecast-dropdown {
        display: none; 
        position: absolute;
        
        top: 100%; 
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        
        width: 90vw;
        max-width: 300px;
        background: white;
        z-index: 10000;
        
        margin-top: 8px; 
        
        box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    }
}
