/* Custom CSS for Ealdlar - Anglo-Frisian History and Culture Website */
/* Folkloric, Art Nouveau, Tolkien-inspired theme */

/* Custom Properties */
:root {
    --color-parchment: #f5edd6;
    --color-dark-parchment: #e8dcc0;
    --color-ink: #2b2821;
    --color-ochre: #b3a78c;
    --color-sienna: #8a7e66;
    --color-earth: #5e4b34;
    --color-forest: #3c4e3c;
    --color-sky: #4a6b82;
    --color-accent: #7a4d2f;    /* Rich russet for primary accents */
    --color-accent-bright: #9b6e4e; /* Lighter version for hover states */
    --color-highlight: #4e6c5d; /* Sea green for tertiary highlights */
    --font-runic: 'Aniron', 'Cinzel', serif;
}

/* General Styles */
body {
    font-family: 'Spectral', Georgia, serif;
    line-height: 1.6;
    background-color: var(--color-ink);
    background-image: url('../assets/patterns/knotwork-bg.svg');
    background-attachment: fixed;
    color: var(--color-parchment);
}

/* Stylistic Flourishes */
.knotwork-divider {
    /* Create a runic divider using CSS directly, no SVG */
    position: relative;
    height: 50px;
    margin: 2rem 0;
    text-align: center;
}

.knotwork-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    height: 1px;
    background-color: var(--color-ochre);
}

.knotwork-divider::after {
    content: "ᛖᚫᛚᛞᛚᚫᚱ";  /* EALDLAR in runic letters */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-ochre);
    font-size: 26px;
    letter-spacing: 12px;
    background-color: var(--color-ink);
    padding: 0 15px;
}

.corner-decoration {
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url('../assets/patterns/border-decoration.svg');
    opacity: 0.7;
}

.corner-tl { top: 0; left: 0; transform: rotate(0deg); }
.corner-tr { top: 0; right: 0; transform: rotate(90deg); }
.corner-bl { bottom: 0; left: 0; transform: rotate(270deg); }
.corner-br { bottom: 0; right: 0; transform: rotate(180deg); }

/* Navbar Styles */
.navbar {
    border-bottom: 2px solid var(--color-sienna);
    padding: 0.75rem 0;
    background-color: rgba(33, 30, 23, 0.95);
    font-family: var(--font-runic);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: var(--color-ochre) !important;
}

.nav-link {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin: 0 0.3rem;
    position: relative;
}

.nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-sienna);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background-color: rgba(43, 40, 33, 0.9);
    padding: 4rem 0;
    position: relative;
    border-bottom: 2px solid var(--color-sienna);
    overflow: hidden;
}

/* Enhanced Carousel Styles */
#featuredArticlesCarousel {
    position: relative;
    overflow: visible;
    min-height: 380px;
    max-width: 800px;
    margin: 0 auto;
    --arrow-offset: -60px;
}

.carousel-inner {
    height: 380px;
    overflow: visible;
}

.carousel-item {
    height: 380px;
    overflow: visible;
}

/* Carousel Container */
.carousel-inner {
    border-radius: 8px;
}

/* Enhanced Navigation Arrows - Reset all positioning */
#featuredArticlesCarousel {
    position: relative !important;
}

#featuredArticlesCarousel .carousel-control-prev,
#featuredArticlesCarousel .carousel-control-next {
    width: 40px !important;
    height: 40px !important;
    background: none !important;
    border: none !important;
    opacity: 0.8 !important;
    transition: all 0.3s ease !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    position: absolute !important;
    z-index: 10 !important;
}

#featuredArticlesCarousel .carousel-control-prev {
    left: -25px !important;
    right: auto !important;
}

#featuredArticlesCarousel .carousel-control-next {
    right: -25px !important;
    left: auto !important;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: none;
}

.carousel-control-prev::after,
.carousel-control-next::after {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border-style: solid;
    border-width: 0 4px 4px 0;
    border-color: var(--color-parchment);
    position: absolute;
    top: 50%;
    left: 50%;
}

.carousel-control-prev::after {
    transform: translate(-25%, -50%) rotate(135deg);
}

.carousel-control-next::after {
    transform: translate(-75%, -50%) rotate(-45deg);
}

/* Enhanced Indicators */
.carousel-indicators {
    bottom: -3rem;
    margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-ochre);
    border: 2px solid var(--color-accent);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    opacity: 1;
    background-color: var(--color-accent);
    transform: scale(1.2);
}

/* Featured Article Cards in Carousel */
.carousel .card.featured {
    background: rgba(245, 237, 214, 0.98);
    border: 2px solid var(--color-ochre);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 3px rgba(179, 167, 140, 0.3);
    color: var(--color-ink);
    border-radius: 12px;
    overflow: hidden;
    height: 350px;
    margin: 5px 0;
    padding: 0;
}

.carousel .card.featured .row {
    height: 100%;
    margin: 0;
}

.carousel .card.featured .col-md-6 {
    height: 100%;
    padding: 0;
}

.carousel .card.featured .col-md-6:first-child {
    display: flex;
}

.carousel .card.featured .col-md-6:first-child img {
    border-radius: 12px 0 0 12px;
}

.carousel .card.featured .card-body {
    background: linear-gradient(to bottom right, 
        rgba(245, 237, 214, 0.95), 
        rgba(232, 220, 192, 0.95));
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
}

.carousel .card.featured h4 {
    color: var(--color-accent);
    font-family: var(--font-runic);
    font-weight: 600;
    margin-bottom: 1rem;
}

.carousel .card.featured .card-text {
    color: var(--color-earth);
    line-height: 1.7;
}

.carousel .card.featured .btn-primary {
    background: linear-gradient(45deg, var(--color-accent), var(--color-accent-bright));
    border: 2px solid var(--color-ochre);
    color: var(--color-parchment);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.carousel .card.featured .btn-primary:hover {
    background: linear-gradient(45deg, var(--color-accent-bright), var(--color-accent));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 77, 47, 0.4);
}

.carousel .card.featured .btn-outline-primary {
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
}

.carousel .card.featured .btn-outline-primary:hover {
    background: var(--color-accent);
    color: var(--color-parchment);
    transform: translateY(-2px);
}

/* Mobile Responsive Layout */
@media (max-width: 767px) {
    #featuredArticlesCarousel {
        margin: 0;
        max-width: 100%;
        min-height: auto;
    }
    
    #featuredArticlesCarousel .carousel-control-prev {
        left: 10px !important;
    }
    
    #featuredArticlesCarousel .carousel-control-next {
        right: 10px !important;
    }
    
    .carousel-inner {
        height: auto;
        min-height: 500px;
    }
    
    .carousel-item {
        height: auto;
        min-height: 500px;
        padding: 0 1rem;
    }
    
    .carousel .card.featured {
        height: auto;
        min-height: 480px;
    }
    
    /* Stack image and content vertically on mobile */
    .carousel .card.featured .row {
        flex-direction: column;
        height: auto;
    }
    
    .carousel .card.featured .col-md-6 {
        width: 100%;
        max-width: 100%;
        flex: none;
        height: auto;
    }
    
    .carousel .card.featured .col-md-6:first-child {
        min-height: 220px;
        max-height: 220px;
    }
    
    .carousel .card.featured .col-md-6:last-child {
        min-height: 250px;
        flex: 1;
    }
    
    .carousel .card.featured .col-md-6:first-child img {
        border-radius: 12px 12px 0 0;
        width: 100%;
        height: 220px;
        object-fit: cover;
    }
    
    .carousel .card.featured .card-body {
        border-radius: 0 0 12px 12px;
        padding: 1.25rem;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    #featuredArticlesCarousel .carousel-control-prev,
    #featuredArticlesCarousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    

}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    #featuredArticlesCarousel {
        max-width: 90%;
        margin: 0 auto;
    }
    
    #featuredArticlesCarousel .carousel-control-prev {
        left: -30px !important;
    }
    
    #featuredArticlesCarousel .carousel-control-next {
        right: -30px !important;
    }
}

/* Desktop constraints */
@media (min-width: 992px) {
    #featuredArticlesCarousel {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;
        min-height: 400px;
        position: relative;
    }
    
    #featuredArticlesCarousel .carousel-control-prev {
        left: -60px !important;
    }
    
    #featuredArticlesCarousel .carousel-control-next {
        right: -60px !important;
    }
}
    
    .carousel-inner {
        max-width: 100%;
        overflow: visible;
        min-height: 400px;
    }
    
    .carousel-item {
        padding: 0 1rem;
        min-height: 400px;
        height: auto;
    }
    
    .carousel .card.featured {
        max-width: 900px;
        margin: 0 auto;
        height: auto;
        min-height: 380px;
    }
    
    .carousel .card.featured .row {
        height: 100%;
    }
    
    .carousel .card.featured .col-md-6 {
        height: auto;
    }
    

}

/* Extra wide desktop constraints */
@media (min-width: 1400px) {
    #featuredArticlesCarousel {
        max-width: 1300px;
        padding: 0 3rem;
    }
    
    .carousel .card.featured {
        max-width: 1000px;
    }
    
    #featuredArticlesCarousel .carousel-control-prev {
        left: -85px !important;
    }
    
    #featuredArticlesCarousel .carousel-control-next {
        right: -85px !important;
    }
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.7;
}

.hero-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.7;
    transform: rotate(180deg);
}

.hero-section h1 {
    font-weight: 700;
    font-family: var(--font-runic);
    letter-spacing: 1px;
    color: var(--color-ochre);
}

.historical-illustration {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    transition: transform 0.5s ease;
}

.historical-illustration::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(93, 75, 52, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.historical-illustration:hover {
    transform: translateY(-5px);
}

/* Card Styling */
.card {
    border: none;
    border-radius: 0;
    margin-bottom: 1.5rem;
    background-color: rgba(43, 40, 33, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--color-sienna);
    opacity: 0.3;
}

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

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-family: var(--font-runic);
    color: var(--color-accent);
}

/* Highlighted card styling */
.card.highlight {
    border-top: 3px solid var(--color-highlight);
}

.card.highlight .card-title {
    color: var(--color-highlight);
}

.card.highlight::before {
    background-color: var(--color-highlight);
}

/* Featured card styling */
.card.featured {
    border-top: 3px solid var(--color-accent);
}

.card.featured .card-title {
    color: var(--color-accent);
}

.card.featured::before {
    background-color: var(--color-accent);
}

/* Fonts and Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-runic);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-ochre);
}

.display-4, .display-5 {
    font-weight: 700;
    letter-spacing: 1px;
}

.lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-dark-parchment);
}

/* List Styles */
ul:not(.navbar-nav):not(.list-unstyled):not(.list-group) {
    padding-left: 1.5rem;
}

ul:not(.navbar-nav):not(.list-unstyled):not(.list-group) li {
    margin-bottom: 0.5rem;
    position: relative;
}

ul:not(.navbar-nav):not(.list-unstyled):not(.list-group) li::before {
    content: "•";
    color: var(--color-sienna);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Button Styles */
.btn {
    border-radius: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
    border-width: 2px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn:hover::after {
    left: 100%;
}

.btn-secondary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-parchment);
}

.btn-secondary:hover {
    background-color: var(--color-accent-bright);
    border-color: var(--color-accent);
}

.btn-outline-secondary {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-outline-secondary:hover {
    background-color: rgba(122, 77, 47, 0.15);
    color: var(--color-accent-bright);
    border-color: var(--color-accent-bright);
}

/* Highlight button - tertiary action */
.btn-highlight {
    background-color: var(--color-highlight);
    border-color: var(--color-highlight);
    color: var(--color-parchment);
}

.btn-highlight:hover {
    background-color: rgba(78, 108, 93, 0.85);
    border-color: var(--color-highlight);
    color: var(--color-parchment);
}

.btn-outline-highlight {
    color: var(--color-highlight);
    border-color: var(--color-highlight);
}

.btn-outline-highlight:hover {
    background-color: rgba(78, 108, 93, 0.15);
    color: var(--color-highlight);
}

/* Footer Styles */
footer {
    background-color: rgba(33, 30, 23, 0.95);
    border-top: 2px solid var(--color-sienna);
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.7;
    transform: rotate(180deg);
}

footer h5 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    position: relative;
    display: inline-block;
}

footer h5::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--color-sienna);
}

footer a {
    color: var(--color-dark-parchment);
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--color-ochre);
    text-decoration: none;
}

/* Hero Image Text Shadow for overlay text */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
}

/* Table Styles */
.table {
    background-color: rgba(43, 40, 33, 0.5);
    color: var(--color-parchment);
    border: 1px solid var(--color-sienna);
}

.table thead th {
    background-color: rgba(122, 77, 47, 0.25);
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-accent);
    font-family: var(--font-runic);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.table tbody tr:nth-of-type(odd) {
    background-color: rgba(43, 40, 33, 0.7);
}

.table tbody tr:hover {
    background-color: rgba(122, 77, 47, 0.1);
}

/* Highlight and emphasis text */
.text-highlight {
    color: var(--color-highlight);
}

.text-accent {
    color: var(--color-accent);
}

.map-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin: 1rem 0;
}

.map-container img {
    transition: transform 0.5s ease;
    border-radius: 4px;
}

.map-container img:hover {
    transform: scale(1.02);
}

.map-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.5;
    pointer-events: none;
    z-index: 10;
}

.map-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.5;
    transform: rotate(180deg);
    pointer-events: none;
    z-index: 10;
}

.badge-highlight {
    background-color: var(--color-highlight);
    color: var(--color-parchment);
    padding: 0.35em 0.65em;
    border-radius: 0;
    font-weight: 500;
}

.badge-accent {
    background-color: var(--color-accent);
    color: var(--color-parchment);
    padding: 0.35em 0.65em;
    border-radius: 0;
    font-weight: 500;
}

/* Accordion Styles */
.accordion-item {
    background-color: rgba(43, 40, 33, 0.7);
    border: none;
    margin-bottom: 0.5rem;
}

.accordion-button {
    background-color: rgba(43, 40, 33, 0.9);
    color: var(--color-ochre);
    font-family: var(--font-runic);
    font-weight: 500;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--color-sienna);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(138, 126, 102, 0.2);
    color: var(--color-ochre);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--color-sienna);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b3a78c'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Element-specific styles */
blockquote {
    border-left: 3px solid var(--color-sienna);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--color-dark-parchment);
    position: relative;
}

blockquote::before {
    content: """;
    font-size: 3rem;
    position: absolute;
    left: 5px;
    top: -15px;
    color: var(--color-sienna);
    opacity: 0.5;
}

.blockquote-footer {
    color: var(--color-ochre);
    opacity: 0.7;
}

/* Section Dividers */
.bg-dark-subtle {
    background-color: rgba(43, 40, 33, 0.7) !important;
    position: relative;
    border-top: 1px solid var(--color-sienna);
    border-bottom: 1px solid var(--color-sienna);
}

.bg-dark-subtle::before, .bg-dark-subtle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('../assets/patterns/knotwork-border.svg');
    background-repeat: repeat-x;
    opacity: 0.5;
}

.bg-dark-subtle::before {
    top: 0;
    transform: rotate(180deg);
}

.bg-dark-subtle::after {
    bottom: 0;
}

/* Timeline Styling */
.timeline::before {
    background-color: var(--color-sienna);
}

.timeline-marker {
    background-color: var(--color-ochre);
    border: 2px solid var(--color-sienna);
}

/* List Group Styling */
.list-group-item {
    background-color: rgba(43, 40, 33, 0.7);
    border-color: var(--color-sienna);
    color: var(--color-parchment);
}

.list-group-item h5 {
    color: var(--color-ochre);
    font-family: var(--font-runic);
}

/* Form Styling */
.form-control {
    background-color: rgba(43, 40, 33, 0.8);
    border: 1px solid var(--color-sienna);
    color: var(--color-parchment);
}

.form-control:focus {
    background-color: rgba(43, 40, 33, 0.9);
    border-color: var(--color-ochre);
    color: var(--color-parchment);
    box-shadow: 0 0 0 0.2rem rgba(179, 167, 140, 0.25);
}

.form-control::placeholder {
    color: rgba(232, 220, 192, 0.5);
}

/* Custom Social Links */
.social-links a {
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Language Selector Styling */
.language-selector-sticky {
    position: fixed;
    bottom: 10px;
    right: 10px; 
    width: auto;
    z-index: 1050;
    background-color: rgba(33, 30, 23, 0.9);
    border: 1px solid var(--color-sienna);
    border-radius: 20px;
    padding: 4px 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
    backdrop-filter: blur(5px);
}

.language-selector-sticky .btn-group {
    display: inline-flex;
    justify-content: center;
}

.language-btn {
    font-family: var(--font-runic);
    font-size: 0.75rem;
    padding: 1px 6px;
    color: var(--color-ochre);
    background-color: transparent;
    transition: all 0.2s ease;
    margin: 0 2px;
    min-width: 24px;
    text-decoration: none;
    display: inline-block;
    border-radius: 12px;
    border: 1px solid rgba(179, 167, 140, 0.3);
}

.language-btn:hover, .language-btn.active {
    background-color: var(--color-sienna);
    color: var(--color-parchment);
    border-color: var(--color-sienna);
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* Custom styling for language selectors */
.language-btn[data-language="en"], .language-btn[data-language="fy"] {
    font-weight: 500;
}

.language-btn[data-language="ang"], .language-btn[data-language="ofs"] {
    font-style: italic;
}
