/*
Theme Name: KBL
Description: Københavns Bueskyttelaug custom theme
Version: 1.1
*/

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-y: scroll;
    height: 100%;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #333;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: #6ba888; text-decoration: none; }
a:hover { color: #5b9e6f; text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    color: #212121;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

p { margin-bottom: 1em; }
ul, ol { margin: 0 0 1em 1.5em; }

/* =============================================
   LAYOUT
   The .container is the single source of truth
   for horizontal margins on all pages.
   ============================================= */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 40px;
}

/* =============================================
   HEADER
   Full-width dark background; content constrained
   by .container inside.
   ============================================= */
.site-header {
    background: #2b2b2b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 110px;
    gap: 20px;
}

.site-title {
    flex-shrink: 0;
}

.site-title a {
    font-size: 1.3em;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.site-title a:hover { color: #93C775; }

/* Logo: fixed size so flex never squeezes it */
.custom-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.custom-logo-link img,
.custom-logo {
    height: 50px;
    width: 50px;
    object-fit: contain;
    display: block;
}

/* =============================================
   NAV
   ============================================= */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 110px;
}

.main-nav ul li {
    position: relative;
    display: flex;
    align-items: center;
    height: 110px;
}

.main-nav ul li > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: #ccc;
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s;
}

.main-nav ul li > a:hover,
.main-nav ul li.current-menu-item > a,
.main-nav ul li.current_page_item > a { color: #6ba888; }

/* Dropdown */
.main-nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-top: 2px solid #6ba888;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    z-index: 200;
}

.main-nav ul li:hover > ul { display: flex; }

.main-nav ul li ul li {
    height: auto;
    display: block;
}

.main-nav ul li ul li > a {
    height: auto;
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.main-nav ul li ul li > a:hover { background: #f9f9f9; }

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #ccc;
    padding: 8px;
}

/* =============================================
   HERO
   Full-width dark background; text is centered.
   ============================================= */
.hero {
    background: #212121;
    color: #fff;
    text-align: center;
    padding: 80px 40px;
    flex-shrink: 0;
}

.hero h1 { color: #fff; font-size: 2.5em; margin-bottom: 0.5em; }
.hero p  { color: #ddd; font-size: 1.1em; margin-bottom: 1.5em; }

.btn {
    display: inline-block;
    background: #6ba888;
    color: #fff;
    padding: 12px 28px;
    border-radius: 3px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn:hover { background: #5b9e6f; color: #fff; text-decoration: none; }

/* =============================================
   MAIN CONTENT  (flex: 1 pushes footer down)
   ============================================= */
.site-content {
    flex: 1;
    padding: 40px 0;
}

.entry-content h2 {
    border-bottom: 2px solid #6ba888;
    padding-bottom: 8px;
    margin-top: 1.5em;
}

/* Feature boxes */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-box h3 {
    border-bottom: 2px solid #6ba888;
    padding-bottom: 8px;
    margin-bottom: 10px;
    font-size: 1em;
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1em 0; }
th, td { padding: 10px 14px; border-bottom: 1px solid #e2e2e2; text-align: left; }
tr:nth-child(odd) { background: #f9f9f9; }
th { background: #6ba888; color: #fff; }

/* Posts */
.post-card { border-bottom: 1px solid #e2e2e2; padding: 24px 0; }
.post-card h2 { font-size: 1.3em; margin-bottom: 6px; }
.post-meta { color: #888; font-size: 0.85em; margin-bottom: 10px; }
.read-more { font-weight: 600; color: #6ba888; }

/* =============================================
   FOOTER
   Full-width dark background; content constrained
   by .container inside.
   ============================================= */
.site-footer {
    background: #212121;
    color: #ccc;
    padding: 30px 0;
    font-size: 1em;
    flex-shrink: 0;
}

.site-footer a { color: #93C775; }
.site-footer a:hover { color: #6ba888; text-decoration: underline; }

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 16px;
    color: #888;
    text-align: center;
}

/* Footer column headings */
.footer-col strong {
    display: block;
    color: #fff;
    font-size: 1em;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

.footer-col p {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* Footer training schedule table */
.footer-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.footer-table td {
    padding: 4px 0;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 1em;
}

.footer-table td:first-child {
    width: 90px;
    color: #aaa;
}

.footer-table tr:nth-child(odd) { background: transparent; }

/* "KBL er en del af" + BD logo */
.footer-member-of {
    margin-top: 20px;
}

.footer-member-of span {
    display: block;
    color: #fff;
    font-size: 1.4em;
    margin-bottom: 8px;
}

{
    height: 40px;
    width: auto;
    opacity: 0.8;
}

.footer-bd-logo {
    height: 110px;
    width: auto;
    opacity: 0.85;
}

.footer-bd-logo:hover { opacity: 1; }

/* =============================================
   EVENTS CALENDAR
   ============================================= */
.tribe-events a { color: #6ba888 !important; }
#tribe-events .tribe-events-button,
.tribe-events-button {
    background-color: #6ba888 !important;
    border-color: #5b9e6f !important;
    color: #fff !important;
}
.tribe-events-calendar td.tribe-events-present div[id*="tribe-events-daynum-"] {
    background-color: #6ba888 !important;
    color: #fff !important;
}

/* Events calendar page: let it push footer down */
.tribe-events-view,
.tribe-common-l-container,
.tribe-events-l-container {
    flex: 1;
}

/* =============================================
   WORDPRESS ADMIN BAR
   ============================================= */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .hero { padding: 60px 20px; }
    .menu-toggle { display: block; }
    .main-nav { display: none; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; height: auto; }
    .main-nav ul li { height: auto; display: block; }
    .main-nav ul li > a { height: auto; padding: 14px 16px; border-bottom: 1px solid #3a3a3a; }
    .main-nav ul li ul { position: static; box-shadow: none; border-top: none; display: none; }
    .main-nav ul li.open > ul { display: flex; }
    .hero h1 { font-size: 1.8em; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}

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

/* =============================================
   EVENTS CALENDAR - targeted color overrides
   Reset all links to dark; only keep green on
   nav arrows and search button.
   ============================================= */

/* Reset all tribe links to dark */
.tribe-common a,
.tribe-events a {
    color: #333 !important;
    text-decoration: none !important;
}

.tribe-common a:hover,
.tribe-events a:hover {
    color: #6ba888 !important;
    text-decoration: underline !important;
}

/* Navigation arrows < > stay green */
.tribe-events-c-top-bar__nav-link,
.tribe-events-c-top-bar__nav-link:visited {
    color: #6ba888 !important;
}

.tribe-events-c-top-bar__nav-link:hover {
    color: #5b9e6f !important;
}

/* "Find begivenheder" search button - green background */
.tribe-events-c-search__button,
.tribe-events-c-events-bar__search-button {
    background-color: #6ba888 !important;
    border-color: #6ba888 !important;
    color: #fff !important;
}

.tribe-events-c-search__button:hover,
.tribe-events-c-events-bar__search-button:hover {
    background-color: #5b9e6f !important;
    border-color: #5b9e6f !important;
    color: #fff !important;
}

/* Remove green borders from btn-border elements */
.tribe-common-c-btn-border,
.tribe-common-c-btn-border-small {
    border-color: #ccc !important;
    color: #333 !important;
}

.tribe-common-c-btn-border:hover,
.tribe-common-c-btn-border-small:hover {
    border-color: #6ba888 !important;
    color: #6ba888 !important;
}

/* View selector tabs (Liste/Måned/Dag) */
.tribe-events-c-view-selector__list-item-link {
    color: #333 !important;
}

.tribe-events-c-view-selector__list-item--active .tribe-events-c-view-selector__list-item-link {
    color: #6ba888 !important;
}

/* Subscribe/iCal links */
.tribe-events-c-subscribe-dropdown__list-item-link {
    color: #333 !important;
}

/* Today button */
.tribe-events-c-nav__today {
    color: #333 !important;
    border-color: #ccc !important;
}
