:root {
    --primary-color: #d72830;
    --secondary-color: rgb(123, 10, 7);
    --dark: #222;
    --light: #f9f9f9;
    --text-color: #333;
    --accent: #f1f1f1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --gold: #c7ae6a;
}

body {
    font-family: 'Roboto Condensed', sans-serif;
    margin: 0;
    background-color: var(--light);
    color: var(--text-color);
    line-height: 1.6;
    background-size: 100%;
    background-image: url('images/paper-texture.jpg');
}

header {
    background: linear-gradient(to right, #000000, #d72830);
    box-shadow: var(--shadow);
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-container {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    background: white;
    top: 0 !important;
    clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 60% 100%, 40% 100%, 0% 80%);
    z-index: 5555;
}

header img {
    width: 70px;
    height: 70px;
    padding: 5px;
}

h1, h2, .news-item h2, h3, a {
    font-family: 'Teko', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

header h1 {
    font-size: 1.75rem;
    margin-left: 120px;
    color: var(--light);
    flex: 0 1 auto;
    margin-bottom: 0;
    margin-top: 0;
    padding: 10px 0;
}

h1 {
    color: #d72731 !important;
}
nav {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 4em;
    margin-bottom: 10px;
    padding-top: 10px;
}

nav a {
    font-size: 16px;
}

nav a, h1 a {
    color: var(--light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 700;
    border-bottom: 2px solid transparent; /* Keep height consistent */
    transition: border-color 0.3s ease;
}

nav a:hover, h1 a:hover {
    border-bottom-color: white;
    color: #fff;
}

.anniversary-150 {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-image: url('images/anniversary-150.png');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 8px;  /* spacing between icon and text */
    vertical-align: middle;
}

.music-festival {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-image: url('images/music-festival.png');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 8px;  /* spacing between icon and text */
    vertical-align: middle;
}

/* Dropdown base */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 0; /* Remove this or set it to 0 */
}

.dropdown .dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--primary-color);
    min-width: 200px;
    box-shadow: var(--shadow);
    z-index: 15;
    flex-direction: column;
    top: 100%;
    margin-top: -5px; /* Pull it up slightly */
    padding-top: 5px; /* Add padding to preserve spacing visually */
}

.dropdown:hover .dropdown-content {
    display: flex;
}

.dropdown-content li {
    list-style: none;
    position: relative;
}

.dropdown-content li a {
    display: block;
    padding: 0.75rem 1rem;
    text-align: left;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.dropdown-content li a:hover {
    background-color: var(--gold);
    color: var(--light);
}

/* Nested submenu */
.dropdown-submenu > ul {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 180px;
    background-color: var(--primary-color);
    box-shadow: var(--shadow);
    z-index: 16;
}

.dropdown-submenu:hover > ul {
    display: block;
}

.dropdown-submenu {
    position: relative;
    padding: 0;
    margin: 0;
}

.dropdown-submenu > ul {
    left: 100%;
    top: 0;
    margin-left: -1px; /* 💡 Prevents the hover "gap" */
    padding: 0;
    border-left: 1px solid rgba(255,255,255,0.2); /* Optional visual cue */
}



ul.dropdown-content {
    padding-left: 0;
}

/* Mobile override */
@media (max-width: 1180px) {
    .dropdown .dropdown-content,
    .dropdown-submenu > ul {
        position: static;
        display: none;
        box-shadow: none;
    }

    .dropdown.show .dropdown-content,
    .dropdown-submenu.show > ul {
        display: block;
    }

    .dropdown-content li a {
        padding-left: 0;
    }

    .dropdown-content > li > a {
        padding-left: 0.5rem; /* Slight left padding if total removal looks too cramped */
    }
    .dropdown-submenu li a {
        /*padding-left: 3rem;*/
    }

    .dropdown {
        display: contents;
    }
}


.hero {
    position: relative;
    height: 330px;
    overflow: hidden;
    background-color: #000;
    width: 100%;
}

.hero img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease-in-out;
}

.hero img.active {
    opacity: 1;
    z-index: 1;
}

.hero h2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gold);
    opacity: 0.9 !important;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.75rem;
    font-weight: bold;
    z-index: 2;
    transition: opacity 0.5s ease;
}

#slideshow-link a {
    display: inline-block;
    margin-top: 0.5rem;
    background: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #d72830;
    font-weight: bold;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

#slideshow-link a:hover {
    background-color: #f1efef !important;
}

.section, .banner-section {
    padding: 1.5rem;
    max-width: 1100px;
    margin: auto;
}

.section h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.banner-section {
    padding: 0;
}

.banner-section img {
    width: 100%;
}

.news-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.news-items {
    flex: 2;
}

.news-item {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.news-item h3 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--primary-color);
}

.news-meta {
    font-size: 0.85rem;
    color: #686767;
    margin-bottom: 0.75rem;
}

.news-item img {
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 1rem;
    vertical-align: top;
}

.news-item.pinned {
    border-left: 4px solid #d72830;
    background-color: #fff9f9;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.pinned-badge {
    font-size: 0.9em;
    margin-left: 0.4rem;
    color: #d72830;
    vertical-align: middle;
}

#news-search-controls {
    margin-bottom: 1rem;
}

input#news-search {
    padding: 8px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.button-row {
    display: flex;
    gap: 0.5rem;
}

#news-search-btn, #news-clear-btn {
    flex: 1;
    text-decoration: none;
    box-shadow: var(--shadow);
    border: none;
    border-radius: 2px;
    color: #ffffff;
    cursor: pointer;
    font-family: Chapman, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .6px;
    line-height: 1;
    padding: 10px 20px;
    text-align: center;
    background-color: #d72830;
}

#news-search-btn {
    background-color: var(--gold);
}

.highlight {
    background-color: yellow;
    font-weight: bold;
}

.twitter-container {
    flex: 1;
    max-width: 350px;
    max-height: 650px;
    overflow-y: auto;
}

.contact-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-info {
    flex: 1;
    max-width: 48%;
}

.contact-map {
    flex: 1;
    max-width: 48%;
}

iframe {
    width: 100%;
    height: 300px;
}

footer {
    background: #020000;
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.875rem;
}

footer a {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    nav {
        justify-content: center;
        margin-right: 0;
        margin-top: 30px;
    }

    nav a {
        font-size: 14px;
        padding: 0.2rem 0.4rem;
        margin-right: 5px;
    }

    .hero {
        max-height: 270px;
    }

    .hero h2 {
        width: 90%;
        font-size: 1.25rem;
        text-align: center;
        padding: 1rem;
        top: 40%;
        transform: translate(-50%, -40%);
    }

    .section {
        padding: 1.2rem;
    }

    .news-layout {
        flex-direction: column;
    }

    .news-items {
        width: 100%;
    }

    .twitter-container {
        max-width: 100%;
    }

    .contact-container {
        align-items: center;
    }

    .contact-info,
    .contact-map {
        max-width: 100%;
    }

    .contact-map iframe {
        width: 100%;
        height: 300px;
    }
}

.burger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    margin-left: auto;
    padding: 10px;
    z-index: 11;
}

/* Show burger, hide nav links on small screens */
@media (max-width: 1180px) {
    .burger {
        display: block;
    }


    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-color);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        max-height: 80vh;         /* 💡 Add this */
        overflow-y: auto;         /* 💡 Add this */
    }

    nav.show {
        display: flex;
    }

    nav a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
        /*display: inline-block;*/
    }
    nav a:hover {
        border-bottom: 2px solid;
        border-bottom-color: white;
        color: #ffffff;
        background-color: var(--gold);
    }

    .dropdown-content {
        display: none !important;
    }
}

@media (max-width: 1140px) {
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-color);
        position: absolute !important;
        top: 100%; /* Ensure it's positioned below the header */
        left: 0;
        z-index: 10;
        margin-top: 0; /* Remove unnecessary margin */
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    nav.show {
        display: flex;
    }

    nav a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
        margin-right: 0;
    }

    nav a:hover {
        border-bottom: 2px solid;
        border-bottom-color: white;
        color: #ffffff;
        background-color: var(--gold);
    }

    .burger {
        display: block;
        font-size: 2rem;
        cursor: pointer;
        color: white;
        margin-left: auto;
        padding: 10px;
        z-index: 11;
    }

    /* Adjust burger menu position to align with header */
    header {
        justify-content: space-between;
        padding: 0 20px;
    }

    h1 {
        margin-left: 0; /* Fix any shifting issues on smaller screens */
    }

    header h1 {
        margin-left: 85px;
    }
}


@media (max-width: 370px) {
    header h1 {
        display: none;
    }
}

header {
    background-color: var(--primary-color);
    box-shadow: var(--shadow);
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between; /* Align items with space between them */
    position: sticky;
    top: 0;
    z-index: 10;
}

h1 {
    font-size: 1.75rem;
    color: var(--light);
    margin: 0; /* Remove margins to prevent shifting */
    padding: 10px 0;
    flex: 1; /* Allow h1 to take remaining space */
}


.logo-container {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    background: white;
    top: 0 !important;
    clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 60% 100%, 40% 100%, 0% 80%);
    z-index: 5555;
}

.burger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    margin-left: auto;
    padding: 10px;
    z-index: 11;
}

@media (max-width: 920px) {
    header {
        justify-content: flex-start; /* Align the elements to the left on smaller screens */
    }

    .burger {
        display: block;
    }

    h1 {
        margin-left: 120px; /* Fix this margin so it doesn't shift */
    }
}


/* Overlay effect when menu is open */
body.menu-open {
    overflow: hidden; /* Prevent scrolling when menu is open */
}

/* Make everything behind the menu fade out */
body.menu-open .content {
    opacity: 0.3;
    pointer-events: none; /* Prevent interaction with the background */
}

/* Make header and nav visible and ensure they are not affected by opacity */
header, nav {
    position: relative;
    z-index: 10; /* Ensure header and nav stay on top */
}

/* Optional: Adding a background overlay to emphasize the menu */
body.menu-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 5; /* Position the overlay under the header */
}

/* Make nav items stack vertically on mobile */
@media (max-width: 1140px) {
    nav {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10;
    }

    nav.show {
        display: flex;
    }

    .dropdown-content {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
    }

    .dropdown-content.show {
        display: flex;
    }

    .dropdown a,
    .dropdown-content a {
        padding: 1rem;
        color: white;
        text-align: center;
    }

    .dropdown-content a:hover {
        background-color: var(--gold);
        color: var(--light);
    }
}

.image-x-small {
    max-width: 70px;
    height: auto;
    margin-bottom: 2.5rem;
}

.image-small {
    max-width: 150px;
    height: auto;
    margin-bottom: 2.5rem;
}

.image-medium {
    max-width: 300px;
    height: auto;
    margin-bottom: 2.5rem;
}

.image-large {
    max-width: 600px;
    height: auto;
    margin-bottom: 2.5rem;
}

.image-x-large {
    max-width: 900px;
    height: auto;
    margin-bottom: 2.5rem;
}

.news-item a {
    color: #c8102e; /* WRU-style red */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
    font-size: 18px;
}

.news-item a:hover {
    color: #900020; /* darker red on hover */
    border-bottom: 2px solid #c8102e;
}

.sponsor-bar:before {
    content: 'Sponsored by:';
    padding: 0 10px;
    font-weight: 800;
    text-align: center;
    color: var(--light);
}

.sponsor-bar {
    overflow: hidden;
    padding: 10px 0;
    /*max-width: 1100px;*/
    background: linear-gradient(to right, #000000, #d72830);
    margin: auto;
}

.sponsor-track {
    display: flex;
    gap: 140px;
    animation: scroll 40s linear infinite;
    align-items: center;
}

.sponsor-track img {
    max-height: 70px;
    max-width: 150px;
    object-fit: contain;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

section#fixtures {
    flex: 1 1 0%;
    padding: 0;
}

#fixtures-container {
    font-family: 'Teko', sans-serif;
    font-size: 16px;
    display: grid;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    .twitter-container {
        width: 100%;
    }

    .twitter-timeline {
        width: 100% !important;
    }
}

.date-group {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: var(--light);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.fixture-date {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding: 5px 10px;
    background-color: var(--gold);
}

.fixture-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.home-team, .away-team {
    flex: 1;
    text-align: center;
}

.fixture-time {
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.home-team, .away-team {
    color: #575555;
}

.add-to-calendar {
    margin-bottom: 12px;
}

.add-to-calendar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 200;
    color: #5c5c5c;
    font-size: 0.9rem;
    margin-top: 6px;
    margin-left: 10px;
}

.add-to-calendar a:hover {
    color: #c00;
}

.calendar-icon {
    font-size: 14px;
}

#results-ticker {
    position: relative;
    width: 100%;
    font-family: 'Arial', sans-serif; /* Sports-style font */
    padding: 10px 0;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.ticker-content {
    display: flex;
    animation: scrollTicker 40s linear infinite;
}

.ticker-item {
    margin-right: 80px;  /* Space between items */
    font-size: 16px;      /* Font size */
    font-weight: bold;    /* Make the text bold */

    flex: none;
}

.ticker-item .date {
    padding: 5px 7px;
    background-color: var(--gold);
    color: var(--dark);
    margin-right: 15px;

}

.ticker-item .home-team {
    font-size: 18px;
    color: #d72830;
    font-weight: bold;
    margin-right: 10px;
}

.ticker-item .score {
    color: var(--dark);
    font-weight: bold;
}

.ticker-item .away-team {
    color: #d72830;
    font-weight: bold;
    margin-left: 10px;
}

@keyframes scrollTicker {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}


select#team-select {
    padding: 8px;
    letter-spacing: 1px;
    color: grey;
}