@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/*-----------------ALL--------------------------------*/

:root {
    --blue: #007BFF;
    --red: #FF4500;
    --white: #EAEAEA;
    --black: #000000;
    --charcoal: #333333;
    --bg-page: #1a1a1a; /* ADD THIS LINE - a dark grey/black for the background */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* GLOBAL STYLES (MOBILE FIRST (SMALL) */
h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.75rem; font-weight: 600; }
h4 { font-size: 1.5rem; font-weight: 500; }
h5 { font-size: 1.25rem; font-weight: 500;}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--white);
}

/*-----Mobile First------*/

.container{
    width:100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--white);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--black);
    padding: 10px 20px;
    position: relative; /* Anchor for the dropdown */
    height: 60px;       
}

header h1 {
    margin: 0;
    color: var(--blue);
    font-family: var(--font-heading);
}

/* Target the link, the H1, AND any pseudo-elements like :after */
.homelink, 
.homelink h1, 
.homelink:hover, 
.homelink:active {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: none !important;
    outline: none !important;
    box-shadow: none !important; /* Some modern themes use shadows as underlines */
}

/* --- Hamburger Button --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Sits above the dropdown */
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--blue);
    transition: 0.3s;
}

/* --- Nav Container --- 
   We pin this to the top-left of the header 
   so the menu always drops down from the same spot. */
.headnav {
    position: absolute;
    top: 60px; /* Exactly at the bottom of header */
    right: 0;
    width: 0;  /* Keeps it from interfering with header layout */
}

.nav-links {
    display: none;             
    position: absolute;        
    top: 0;
    right: 0;
    width: 200px;              
    background-color: var(--black);
    flex-direction: column;
    z-index: 1000;             
    box-shadow: 4px 4px 10px rgba(0,0,0,0.4);
    border-right: 2px solid var(--blue);
	animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* The class JS will toggle */
.nav-links.active {
    display: flex !important;
}

#navy li a {
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--white);
    padding: 15px 20px;        
    display: block;
    text-align: left;          
    border-bottom: 1px solid var(--charcoal); 
}

#navy li a:hover {
    background-color: var(--charcoal);
    color: var(--blue);
}
/* Base Message Styles */
.message-container {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 25px;
    color: white;
    border-radius: 4px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-family: var(--font-body);
}

/* Color logic based on Django message tags */
.message-container.success { background-color: var(--blue); }
.message-container.error { background-color: var(--red); }
.message-container.warning { background-color: orange; }
.message-container.info { background-color: var(--charcoal); }

.hero_section{
    display: flex;
    flex-direction: column;
    padding: 120px 20px;
    margin: 0 auto;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.9)0%,
        rgba(0,0,0,0.5) 50%,
        rgba(0, 0, 0, 0.9)100%  
      ), 
      url('../images/hero.jpg');
      background-size: cover;
    color: var(--white);
    align-items: center;
}

.hero_section h2{
    color: var(--blue);
    padding-bottom: 30px;
}
.hero_section p{
    padding:0 50px;
}

/* ---- Post List ---*/

.post-list-sec {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden; /* Prevents the horizontal scroll entirely */
}
.post-list-sec h2{
    padding: 10px 0 0 10px;
    color: var(--blue);
}
.card_wrapper{
    width: 100%;
    margin: 0 auto;
}
.card{
    display: flex;
    flex-wrap: wrap;
    background-color: var(--blue);
    border-radius: 10px;
    box-shadow: 0 0 2.5rem rgba(0, 0, 0, 0.28);
    color: var(--white);
    margin: 20px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid black;
}
.card-image{
    display: flex;
    justify-content: center;
    flex: 1 1 auto;
    align-items: center;
    min-width: 10rem;
    height: 15rem;
    overflow: hidden;
    flex: 1;
}
.card-image img{
    width: auto;
    height: 100%;
    object-fit: cover;
}
.card-content{
    flex: 2;
    padding: 20px;
}
.blog-details,
.icon-text {
    display: flex;
    align-items: center;
}
.blog-details{
    border-left: 1px solid var(--white);
    border-bottom: 1px solid var(--white);
    justify-content: space-evenly;
    padding: 5px 5px 5px 15px
}
.icon-text{
    margin-right: 1rem;
    padding-bottom: 5px;
}

.blog-title{
    padding: 10px;
}
.excerpt{
    font-style: italic;
}
.blog-cta{
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.button{
    padding: 10px;
    background-color: var(--red);
    text-decoration: none;
    color: var(--white);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.button:hover{
    background-color: var(--white);
    color: var(--blue);
    font-size: 1.1rem;
    transform: scale(1.1);    /* Slightly scale the button */
}
.button:focus {
    outline: 3px solid var(--red);
}

/*------ POST DETAILS -------*/


.post-detail-card{
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    background-color: var(--blue);
    border-radius: 10px;
    box-shadow: 0 0 2.5rem rgba(0, 0, 0, 0.28);
    color: var(--white);
    margin: 20px;
    padding: 10px;
    overflow: hidden; /* Hide any overflow */
    max-width: 100%; /* Ensure it doesn't exceed its parent's width */
}
.blog-wrapper{
    margin: 0 auto;
}
.blog-details{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.blog-details span{
    margin-right: 30px;
    font-size: smaller;
    color: var(--white);
    font-weight: bold;
}
.excerpt {
    display: flex;
    flex-direction: column;
    /* Default for mobile: normal spacing */
    text-align: left; 
}

.excerpt p{
    padding: 10px 20px;
}
.img_wrapper{
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
}
.img_wrapper img{
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 15px;
}
.pagination{
    display: flex;
    justify-content: center;
    background-color: var(--white);
    padding: 10px;
    width:90%;
    margin: 10px auto;
    box-shadow: 0 0 2.5rem rgba(0, 0, 0, 0.5);
    border-radius: 15px;
}
.step-links{
    display: flex;
    width: 90%;
    justify-content: space-evenly;
    margin: 0 auto;
}
.current{
    display: flex;
    justify-items: center;
    align-items: center;
    align-content: center;
    color: var(--blue);
    font-weight: bold;
}
.step-links a{
    padding: 10px;
    background-color: var(--blue);
    color: var(--white);
    margin: 5px;
    border-radius: 5px;
    text-decoration: none;
}

/* --- Centering the Auth Content --- */

.auth-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items horizontally */
    text-align: center;   /* Centers text inside elements */
    max-width: 500px;
    margin: 40px auto;
    padding: 40px 20px;
}

/* --- Centering the Form and Inputs --- */
.auth-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Keeps the text boxes in the middle */
}

.auth-form-fields {
    width: 100%;
    max-width: 350px; /* Limits the width of text boxes for better look */
    margin: 0 auto;
}

.auth-form-fields p {
    width: 100%;
    margin-bottom: 1.2rem;
}

/* Styling the Text Boxes */

.auth-form-fields input[type="text"],
.auth-form-fields input[type="password"],
.auth-form-fields input[type="email"] {
    width: 100%; 
    padding: 12px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-family: var(--font-body);
    text-align: center; /* Optional: centers the text inside the box as well */
}

/* --- The Button (Matching your style exactly) --- */
/* We target the Allauth button element specifically */
.auth-card button[type="submit"] {
    /* Copying your .button style */
    padding: 10px 30px; /* Added horizontal padding for a better look */
    background-color: var(--red);
    text-decoration: none;
    color: var(--white);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    border: none; /* Removes default button border */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: 20px;
}

.auth-card button[type="submit"]:hover {
    background-color: var(--white);
    color: var(--blue);
    font-size: 1.1rem;
    transform: scale(1.1);
}

.auth-card button[type="submit"]:focus {
    outline: 3px solid var(--red);
}

/* Helper for the "Remember Me" checkbox to keep it from centering weirdly */
.auth-form-fields input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* Specific layout for Email Management */
.pending-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.help-text {
    font-size: 0.85rem;
    font-style: italic;
    margin: 10px 0;
}

/* Button Grouping for Re-send/Cancel */
.button-group-minor {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

/* Target all buttons in the auth card to use your red style */
.auth-card button,
.auth-card button[type="submit"] {
    padding: 10px 20px;
    background-color: var(--red);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

/* Hover effect from your original .button class */
.auth-card button:hover {
    background-color: var(--white);
    color: var(--blue);
    transform: scale(1.05);
}

/* Style for minor/secondary buttons (Resend/Cancel) */
.auth-card button[name="action_send"],
.auth-card button[name="action_remove"] {
    font-size: 0.8rem;
    padding: 8px 15px;
    background-color: var(--charcoal); /* Distinct from main 'Change' button */
}

.auth-card button[name="action_remove"]:hover {
    background-color: var(--red);
    color: var(--white);
}

/* Ensure disabled inputs (current email) look readable but distinct */
.auth-form-fields input:disabled {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: not-allowed;
    border: 1px dashed var(--white);
}

/*------ FOOTER -------*/


footer{
    display:flex;
    flex-direction:column;
    align-items:center;
    color: var(--white);
    background-color:var(--black);
    padding: 30px;
    padding-bottom:150px;
    font-weight: bold;
}
footer a{
    text-decoration: none;
    font-weight: bold;
    font-size: larger;
    font-style: italic;
    color: var(--blue);
    padding: 0 10px;
    margin-top: 20px;
}
footer a:hover {
    color: var(--white);
}


.footlink{
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 20px;  
}

.footlink a{
    text-decoration: none;
    font-weight: bold;
    font-size: larger;
    font-style: italic;
    color: var(--blue);
    padding: 0 10px;
}

.footlink a:hover {
    color: var(--white);
}

.author-controls{
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: center;
    justify-content: space-evenly;
    padding: 5px;
}

/* --- Create/Edit Post Form Styles --- */

/* Main container for the form */
form {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: var(--black);
    color: var(--white);
    border-radius: 15px;
    border: 1px solid var(--charcoal);
}

form h2, form h3 {
    color: var(--blue);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--charcoal);
    padding-bottom: 10px;
}

/* Style for standard Django form fields (Title, Slug, Category, Content) */
form p {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

form label {
    font-family: var(--font-heading);
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--blue);
}

form input[type="text"],
form input[type="number"],
form select,
form textarea {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--charcoal);
    background-color: var(--white);
    color: var(--black);
    font-family: var(--font-body);
    font-size: 1rem;
}

form textarea {
    min-height: 200px;
    resize: vertical;
}

/* Link for "Add New Category" */
form p a {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
}

form p a:hover {
    text-decoration: underline;
}

/* --- Image Formset Styling --- */

#image-formset-container {
    margin-top: 20px;
}

.image-form-row {
    background-color: var(--charcoal);
    border: 2px solid var(--blue) !important; /* Overriding your inline style */
    border-radius: 10px;
    padding: 15px !important;
    margin-bottom: 15px !important;
    transition: transform 0.2s ease;
}

.image-form-row:hover {
    transform: scale(1.01);
}

/* File inputs within the formset */
.image-form-row input[type="file"] {
    color: var(--white);
    padding: 10px 0;
}

/* --- Buttons --- */

#add-image-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--charcoal);
    color: var(--white);
    border: 1px solid var(--blue);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
}

#add-image-btn:hover {
    background-color: var(--blue);
    color: var(--black);
}

/* Container for the submit button */
.submit-section {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--charcoal) !important; /* Match your palette */
    border-radius: 8px;
}

/* The big Publish/Update button */
form button[type="submit"] {
    background-color: var(--red) !important; /* Use your CSS variable red */
    color: var(--white) !important;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s ease, background-color 0.3s ease !important;
}

form button[type="submit"]:hover {
    background-color: var(--white) !important;
    color: var(--red) !important;
    transform: scale(1.02);
}

/* Only justify on tablets and desktops (wider than 768px) */
@media (min-width: 768px) {
    .excerpt {
        text-align: justify;
        text-justify: inter-word;
    }
}